Code

gitweb: Use $hash_base as $search_hash if possible
authorTimo Hirvonen <tihirvon@gmail.com>
Tue, 20 Jun 2006 13:41:05 +0000 (16:41 +0300)
committerJunio C Hamano <junkio@cox.net>
Thu, 22 Jun 2006 09:23:12 +0000 (02:23 -0700)
$hash (h parameter) does not always point to a commit. Use $hash_base as
$search_hash when it is defined.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.cgi

index f2e50462d9b6160127b35f659ff8586369723b07..e2108dee7c43ba4981c9471bd2ffbed8f77116f8 100755 (executable)
@@ -322,7 +322,9 @@ EOF
                        $searchtext = "";
                }
                my $search_hash;
-               if (defined $hash) {
+               if (defined $hash_base) {
+                       $search_hash = $hash_base;
+               } elsif (defined $hash) {
                        $search_hash = $hash;
                } else {
                        $search_hash  = "HEAD";