]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: tree view: hash_base and hash are now context sensitive
[Gitweb] / gitweb.perl
index b3146d46b9b5a6d1fc9170872d2e5a7e96b5d1b58540d07ce403efb7b1c38bff..590ebddff3ceea70fbfe98b6a42c9e289c5d1437cfa0cd3df4281ef08bc3656c 100755 (executable)
@@ -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";
This page took 0.228634 seconds and 4 git commands to generate.