Skip to content

Commit 2dc7f40

Browse files
committed
Merge branch 'maint'
* maint: gitweb/README: fix AliasMatch in example Test grep --and/--or/--not Test git archive --remote fread does not return negative on error
2 parents 3f721d1 + 1bed73c commit 2dc7f40

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

gitweb/README

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ named without a .git extension (e.g. /pub/git/project instead of
377377

378378
DocumentRoot /var/www/gitweb
379379

380-
AliasMatch ^(/.*?)(\.git)(/.*)? /pub/git$1$3
380+
AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$1$3
381381
<Directory /var/www/gitweb>
382382
Options ExecCGI
383383
AddHandler cgi-script cgi
@@ -402,6 +402,14 @@ http://git.example.com/project
402402

403403
will provide human-friendly gitweb access.
404404

405+
This solution is not 100% bulletproof, in the sense that if some project
406+
has a named ref (branch, tag) starting with 'git/', then paths such as
407+
408+
http://git.example.com/project/command/abranch..git/abranch
409+
410+
will fail with a 404 error.
411+
412+
405413

406414
Originally written by:
407415
Kay Sievers <[email protected]>

strbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
260260
res = fread(sb->buf + sb->len, 1, size, f);
261261
if (res > 0)
262262
strbuf_setlen(sb, sb->len + res);
263-
else if (res < 0 && oldalloc == 0)
263+
else if (oldalloc == 0)
264264
strbuf_release(sb);
265265
return res;
266266
}

t/t5000-tar-tree.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ test_expect_success 'git archive with --output' \
9494
'git archive --output=b4.tar HEAD &&
9595
test_cmp b.tar b4.tar'
9696

97+
test_expect_success 'git archive --remote' \
98+
'git archive --remote=. HEAD >b5.tar &&
99+
test_cmp b.tar b5.tar'
100+
97101
test_expect_success \
98102
'validate file modification time' \
99103
'mkdir extract &&

t/t7002-grep.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,36 @@ do
125125

126126
done
127127

128+
cat >expected <<EOF
129+
file:foo mmap bar_mmap
130+
EOF
131+
132+
test_expect_success 'grep -e A --and -e B' '
133+
git grep -e "foo mmap" --and -e bar_mmap >actual &&
134+
test_cmp expected actual
135+
'
136+
137+
cat >expected <<EOF
138+
file:foo_mmap bar mmap
139+
file:foo_mmap bar mmap baz
140+
EOF
141+
142+
143+
test_expect_success 'grep ( -e A --or -e B ) --and -e B' '
144+
git grep \( -e foo_ --or -e baz \) \
145+
--and -e " mmap" >actual &&
146+
test_cmp expected actual
147+
'
148+
149+
cat >expected <<EOF
150+
file:foo mmap bar
151+
EOF
152+
153+
test_expect_success 'grep -e A --and --not -e B' '
154+
git grep -e "foo mmap" --and --not -e bar_mmap >actual &&
155+
test_cmp expected actual
156+
'
157+
128158
test_expect_success 'log grep setup' '
129159
echo a >>file &&
130160
test_tick &&

0 commit comments

Comments
 (0)