[PATCH] gitweb: Start search from HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Starting search from whatever the current "h" parameter points to is
wrong.  Sometimes it doesn't give all the expected results or may even
fail if h points to an object which is not a commit.

Signed-off-by: Timo Hirvonen <tihirvon@xxxxxxxxx>
---

 This patch is against the "next" branch.

 gitweb/gitweb.cgi |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..3ad23a3 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -292,14 +292,7 @@ EOF
 		if (!defined $searchtext) {
 			$searchtext = "";
 		}
-		my $search_hash;
-		if (defined $hash) {
-			$search_hash = $hash;
-		} else {
-			$search_hash  = "HEAD";
-		}
 		$cgi->param("a", "search");
-		$cgi->param("h", $search_hash);
 		print $cgi->startform(-method => "get", -action => $my_uri) .
 		      "<div class=\"search\">\n" .
 		      $cgi->hidden(-name => "p") . "\n" .
@@ -2328,9 +2321,7 @@ sub git_search {
 	if (!defined $searchtext) {
 		die_error("", "Text field empty.");
 	}
-	if (!defined $hash) {
-		$hash = git_read_head($project);
-	}
+	$hash = "HEAD";
 	my %co = git_read_commit($hash);
 	if (!%co) {
 		die_error(undef, "Unknown commit object.");
-- 
1.4.0.gd281
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]