aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorLuben Tuikov <ltuikov@yahoo.com>2006-09-29 09:57:43 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-30 00:23:23 -0700
commit6f7ea5fb333554887656f7f6ec683544ec6e3c22 (patch)
tree96d68fc902d9afbe5ce0d55b4fef5e57e69b77aa /gitweb
parent6d81c5a2ea6e0b11fdee87d61d073850c17ce6d8 (diff)
downloadgit-6f7ea5fb333554887656f7f6ec683544ec6e3c22.tar.gz
git-6f7ea5fb333554887656f7f6ec683544ec6e3c22.tar.xz
gitweb: tree view: hash_base and hash are now context sensitive
In tree view, by default, hash_base is HEAD and hash is the entry equivalent. Else the user had selected a hash_base or hash, say by clicking on a revision or commit, in which case those values are used. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl18
1 files changed, 9 insertions, 9 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c8557c85c..a3c3e7471 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1672,9 +1672,9 @@ sub git_print_tree_entry {
"history");
}
print " | " .
- $cgi->a({-href => href(action=>"blob_plain",
- hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
- "raw");
+ $cgi->a({-href => href(action=>"blob_plain", hash_base=>$hash_base,
+ file_name=>"$basedir$t->{'name'}")},
+ "raw");
print "</td>\n";
} elsif ($t->{'type'} eq "tree") {
@@ -2745,14 +2745,14 @@ sub git_blob {
sub git_tree {
my $have_snapshot = gitweb_have_snapshot();
+ if (!defined $hash_base) {
+ $hash_base = "HEAD";
+ }
if (!defined $hash) {
- $hash = git_get_head_hash($project);
if (defined $file_name) {
- my $base = $hash_base || $hash;
- $hash = git_get_hash_by_path($base, $file_name, "tree");
- }
- if (!defined $hash_base) {
- $hash_base = $hash;
+ $hash = git_get_hash_by_path($hash_base, $file_name, "tree");
+ } else {
+ $hash = $hash_base;
}
}
$/ = "\0";