Skip to content

Commit 5e2c7cd

Browse files
committed
t5551: do not use unportable sed '\+'
The set-up step to prepare a repository with 50000 tags used a non-porable '\+' to match one-or-more. The error was not caught because the next test that uses that repository did not even bother to check if these expected tags were actually cloned to the resulting repository. Fix the sed construct to use BRE and update the "clone" test that wanted to test cloning from such a repository with many refs to check the resulting repository. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92758dd commit 5e2c7cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

t/t5551-http-fetch.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,17 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
184184
185185
# now assign tags to all the dangling commits we created above
186186
tag=$("$PERL_PATH" -e "print \"bla\" x 30") &&
187-
sed -e "s/^:\(.\+\) \(.\+\)$/\2 refs\/tags\/$tag-\1/" <marks >>packed-refs
187+
sed -e "s|^:\([^ ]*\) \(.*\)$|\2 refs/tags/$tag-\1|" <marks >>packed-refs
188188
)
189189
'
190190

191191
test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
192192
git clone $HTTPD_URL/smart/repo.git too-many-refs 2>err &&
193-
test_line_count = 0 err
193+
test_line_count = 0 err &&
194+
(
195+
cd too-many-refs &&
196+
test $(git for-each-ref refs/tags | wc -l) = 50000
197+
)
194198
'
195199

196200
stop_httpd

0 commit comments

Comments
 (0)