Show refs on blobdiff page
Show refs on blobdiff page

--- a/include/display.git_blobdiff.php
+++ b/include/display.git_blobdiff.php
@@ -9,6 +9,7 @@
 
  require_once('util.prep_tmpdir.php');
  require_once('gitutil.git_read_commit.php');
+ require_once('gitutil.read_info_ref.php');
  require_once('display.git_diff_print.php');
 
 function git_blobdiff($projectroot,$project,$hash,$hashbase,$hashparent,$file)
@@ -28,6 +29,9 @@
 		$tpl->assign("tree",$co['tree']);
 		$tpl->assign("title",$co['title']);
 		$tpl->assign("file",$file);
+		$refs = read_info_ref($projectroot . $project);
+		if (isset($refs[$hashbase]))
+			$tpl->assign("hashbaseref",$refs[$hashbase]);
 		$tpl->display("blobdiff_nav.tpl");
 	} else {
 		$tpl->clear_all_assign();

--- a/templates/blobdiff_nav.tpl
+++ b/templates/blobdiff_nav.tpl
@@ -9,5 +9,9 @@
  <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hashbase}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hashbase}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hashbase}">tree</a><br />
  <a href="{$SCRIPT_NAME}?p={$project}&a=blobdiff_plain&h={$hash}&hp={$hashparent}&f={$file}">plain</a>
  </div>
- <div><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hashbase}" class="title">{$title}</a></div>
+ <div><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hashbase}" class="title">{$title}
+ {if $hashbaseref}
+ <span class="tag">{$hashbaseref}</span>
+ {/if}
+ </a></div>
 

comments