DORMANTno replies

[PATCH] gitweb: Start search from HEAD

From: Timo Hirvonen <hidden>
Date: 2016-06-15 22:42:30
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help