Use readable names in blobdiff and blobdiff_plain
Use readable names in blobdiff and blobdiff_plain

--- a/include/display.git_blobdiff.php
+++ b/include/display.git_blobdiff.php
@@ -27,6 +27,7 @@
 		$tpl->assign("hashparent",$hashparent);
 		$tpl->assign("tree",$co['tree']);
 		$tpl->assign("title",$co['title']);
+		$tpl->assign("file",$file);
 		$tpl->display("blobdiff_nav.tpl");
 	} else {
 		$tpl->clear_all_assign();

--- a/include/display.git_blobdiff_plain.php
+++ b/include/display.git_blobdiff_plain.php
@@ -18,7 +18,7 @@
 		return;
 	}
 	header("Content-type: text/plain; charset=UTF-8");
-	git_diff_print($projectroot . $project, $hashparent,($file?$file:$hashparent),$hash,($file?$file:$hash),"plain");
+	git_diff_print($projectroot . $project, $hashparent,($file?"a/".$file:$hashparent),$hash,($file?"b/".$file:$hash),"plain");
 }
 
 ?>

--- a/templates/blobdiff_header.tpl
+++ b/templates/blobdiff_header.tpl
@@ -9,5 +9,5 @@
  <div class="page_path"><b>/{$file}</b></div>
  {/if}
  <div class="page_body">
- <div class="diff_info">blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hashparent}&hb={$hashbase}&f={$file}">{$hashparent}</a> -&gt; blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hash}&hb={$hashbase}&f={$file}">{$hash}</a></div>
+ <div class="diff_info">blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hashparent}&hb={$hashbase}&f={$file}">{if $file}a/{$file}{else}{$hashparent}{/if}</a> -&gt; blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hash}&hb={$hashbase}&f={$file}">{if $file}b/{$file}{else}{$hash}{/if}</a></div>
 

--- a/templates/blobdiff_nav.tpl
+++ b/templates/blobdiff_nav.tpl
@@ -7,7 +7,7 @@
  *}
  <div class="page_nav">
  <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}">plain</a>
+ <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>
 

comments