Skip to content

Commit

Permalink
gitweb: Allow search to be disabled from the config file.
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Robert Fitzsimons authored and Junio C Hamano committed Dec 23, 2006
1 parent 9d032c7 commit 6be9351
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@
# => [content-encoding, suffix, program]
'default' => ['x-gzip', 'gz', 'gzip']},

# Enable text search, which will list the commits which match author,
# committer or commit text to a given string. Enabled by default.
'search' => {
'override' => 0,
'default' => [1]},

# Enable the pickaxe search, which will list the commits that modified
# a given string in a file. This can be practical and quite faster
# alternative to 'blame', but still potentially CPU-intensive.
Expand Down Expand Up @@ -1730,6 +1736,9 @@ sub git_header_html {
print " / $action";
}
print "\n";
}
my ($have_search) = gitweb_check_feature('search');
if ((defined $project) && ($have_search)) {
if (!defined $searchtext) {
$searchtext = "";
}
Expand Down Expand Up @@ -4151,6 +4160,10 @@ sub git_history {
}

sub git_search {
my ($have_search) = gitweb_check_feature('search');
if (!$have_search) {
die_error('403 Permission denied', "Permission denied");
}
if (!defined $searchtext) {
die_error(undef, "Text field empty");
}
Expand Down

0 comments on commit 6be9351

Please sign in to comment.