Skip to content

Commit 6963a4e

Browse files
peffgitster
authored andcommitted
t5530: check protocol response for "not our ref"
Back in 9f9aa76 (upload-pack: Improve error message when bad ref requested, 2010-07-31), we added a test to make sure that we die with a sensible message when the client asks for an object we don't have. Much later, in bdb31ea (upload-pack: report "not our ref" to client, 2017-02-23), we started reporting that information via an "ERR" line in the protocol. Let's check that part, as well. While we're touching this test, let's drop the "-q" on the grep calls. Our usual test style just relies on --verbose to control output. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 98024d1 commit 6963a4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

t/t5530-upload-pack-error.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ test_expect_success 'upload-pack error message when bad ref requested' '
6262
printf "0045want %s multi_ack_detailed\n00000009done\n0000" \
6363
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" >input &&
6464
test_must_fail git upload-pack . <input >output 2>output.err &&
65-
grep -q "not our ref" output.err &&
66-
! grep -q multi_ack_detailed output.err
65+
grep "not our ref" output.err &&
66+
grep "ERR" output &&
67+
! grep multi_ack_detailed output.err
6768
'
6869

6970
test_expect_success 'upload-pack fails due to error in pack-objects enumeration' '

0 commit comments

Comments
 (0)