Merge branch 'maint'
* maint: Update draft release notes to 1.7.9.2 gitweb: Fix 'grep' search for multiple matches in file
This commit is contained in:
commit
2c8fb23ac7
@ -24,4 +24,7 @@ Fixes since v1.7.9.1
|
|||||||
|
|
||||||
* Search box in "gitweb" did not accept non-ASCII characters correctly.
|
* Search box in "gitweb" did not accept non-ASCII characters correctly.
|
||||||
|
|
||||||
|
* Search interface of "gitweb" did not show multiple matches in the same file
|
||||||
|
correctly.
|
||||||
|
|
||||||
Also contains minor fixes and documentation updates.
|
Also contains minor fixes and documentation updates.
|
||||||
|
@ -5915,9 +5915,10 @@ sub git_search_files {
|
|||||||
my $alternate = 1;
|
my $alternate = 1;
|
||||||
my $matches = 0;
|
my $matches = 0;
|
||||||
my $lastfile = '';
|
my $lastfile = '';
|
||||||
|
my $file_href;
|
||||||
while (my $line = <$fd>) {
|
while (my $line = <$fd>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
my ($file, $file_href, $lno, $ltext, $binary);
|
my ($file, $lno, $ltext, $binary);
|
||||||
last if ($matches++ > 1000);
|
last if ($matches++ > 1000);
|
||||||
if ($line =~ /^Binary file (.+) matches$/) {
|
if ($line =~ /^Binary file (.+) matches$/) {
|
||||||
$file = $1;
|
$file = $1;
|
||||||
|
@ -637,6 +637,45 @@ test_expect_success \
|
|||||||
'config override: tree view, features enabled in repo config (2)' \
|
'config override: tree view, features enabled in repo config (2)' \
|
||||||
'gitweb_run "p=.git;a=tree"'
|
'gitweb_run "p=.git;a=tree"'
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# searching
|
||||||
|
|
||||||
|
cat >>gitweb_config.perl <<\EOF
|
||||||
|
|
||||||
|
# enable search
|
||||||
|
$feature{'search'}{'default'} = [1];
|
||||||
|
$feature{'grep'}{'default'} = [1];
|
||||||
|
$feature{'pickaxe'}{'default'} = [1];
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: preparation' \
|
||||||
|
'echo "1st MATCH" >>file &&
|
||||||
|
echo "2nd MATCH" >>file &&
|
||||||
|
echo "MATCH" >>bar &&
|
||||||
|
git add file bar &&
|
||||||
|
git commit -m "Added MATCH word"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: commit author' \
|
||||||
|
'gitweb_run "p=.git;a=search;h=HEAD;st=author;s=A+U+Thor"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: commit message' \
|
||||||
|
'gitweb_run "p=.git;a=search;h=HEAD;st=commitr;s=MATCH"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: grep' \
|
||||||
|
'gitweb_run "p=.git;a=search;h=HEAD;st=grep;s=MATCH"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: pickaxe' \
|
||||||
|
'gitweb_run "p=.git;a=search;h=HEAD;st=pickaxe;s=MATCH"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'search: projects' \
|
||||||
|
'gitweb_run "a=project_list;s=.git"'
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# non-ASCII in README.html
|
# non-ASCII in README.html
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user