diff options
Diffstat (limited to 't/t5530-upload-pack-error.sh')
-rwxr-xr-x | t/t5530-upload-pack-error.sh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh index 044603c26e..4f6e32b04c 100755 --- a/t/t5530-upload-pack-error.sh +++ b/t/t5530-upload-pack-error.sh @@ -4,7 +4,7 @@ test_description='errors in upload-pack' . ./test-lib.sh -D=`pwd` +D=$(pwd) corrupt_repo () { object_sha1=$(git rev-parse "$1") && @@ -35,8 +35,8 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && - grep "pack-objects died" output.err + test_i18ngrep "unable to read" output.err && + test_i18ngrep "pack-objects died" output.err ' test_expect_success 'corrupt repo differently' ' @@ -54,12 +54,18 @@ test_expect_success 'upload-pack fails due to error in rev-list' ' printf "0032want %s\n0034shallow %s00000009done\n0000" \ $(git rev-parse HEAD) $(git rev-parse HEAD^) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - # pack-objects survived - grep "Total.*, reused" output.err && - # but there was an error, which must have been in rev-list grep "bad tree object" output.err ' +test_expect_success 'upload-pack error message when bad ref requested' ' + + printf "0045want %s multi_ack_detailed\n00000009done\n0000" \ + "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" >input && + test_must_fail git upload-pack . <input >output 2>output.err && + grep -q "not our ref" output.err && + ! grep -q multi_ack_detailed output.err +' + test_expect_success 'upload-pack fails due to error in pack-objects enumeration' ' printf "0032want %s\n00000009done\n0000" \ |