File: gitweb-fix-pickaxe.diff

package info (click to toggle)
git-core 1%3A1.4.4.4-4%2Betch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 6,028 kB
  • ctags: 5,446
  • sloc: ansic: 50,083; sh: 14,854; perl: 12,752; tcl: 5,714; python: 2,754; makefile: 981; lisp: 977; asm: 219
file content (26 lines) | stat: -rw-r--r-- 856 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Backport of:

From: Jakub Narebski <jnareb@gmail.com>
Date: Wed, 5 Mar 2008 08:31:55 +0000 (+0100)
Subject: gitweb: Fix and simplify pickaxe search
X-Git-Tag: v1.5.5-rc0~48^2
X-Git-Url: http://repo.or.cz/w/git.git?a=commitdiff_plain;h=c582abae

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7587595..832091e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3970,9 +3970,10 @@ sub git_search {
 
 	if ($searchtype eq 'pickaxe') {
 		$/ = "\n";
-		my $git_command = git_cmd_str();
-		open my $fd, "-|", "$git_command rev-list $hash | " .
-			"$git_command diff-tree -r --stdin -S\'$searchtext\'";
+		my $cmd = quote_command(git_cmd(), 'rev-list', $hash) . "|"
+		    . quote_command(git_cmd(), qw/diff-tree -r --stdin/,
+				    "-S$searchtext");
+		open my $fd, "-|", $cmd;
 		undef %co;
 		my @files;
 		while (my $line = <$fd>) {