Skip to content

Commit 821d8f2

Browse files
peffgitster
authored andcommitted
t5516: beef up exact-oid ref prefixes test
Commit 6c301ad (fetch: do not pass ref-prefixes for fetch by exact SHA1, 2018-05-31) added a test that fetching an exact oid with the v2 protocol works. Originally it failed without the code change from that commit, because fetch failed with "no matching remote head". That changed in 0177565 (transport: do not list refs if possible, 2018-09-27), which made fetch more forgiving of this case. But that now meant the test passes even without its fix! So let's also have it check the packet listing to make sure we did not ask for the bogus prefix (ultimately this is less important than whether the command fails, since it's just an optimization, but we should make sure not to regress it). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6ea26f3 commit 821d8f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/t5516-fetch-push.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,10 @@ test_expect_success 'fetch exact oid in protocol v2' '
13121312
test_must_fail git -C child cat-file -t $the_commit &&
13131313
13141314
# fetching the hidden object succeeds by default
1315-
git -C child fetch -v ../testrepo $the_commit:refs/heads/copy
1315+
GIT_TRACE_PACKET=$PWD/trace.out \
1316+
git -C child fetch -v ../testrepo $the_commit:refs/heads/copy &&
1317+
1318+
test_grep ! "ref-prefix.*$the_commit" trace.out
13161319
'
13171320

13181321
for configallowtipsha1inwant in true false

0 commit comments

Comments
 (0)