Diff options
| -rwxr-xr-x | tests/t0303-robustness.sh | 7 |
1 file changed, 4 insertions, 3 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 1911cf8..6053de0 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -467,7 +467,7 @@ test_expect_success 'a corrupt blob in a collected diff answers the error' ' test_seq 2000 | sed "s/^5/X/" >f && git commit -q -a -m two && blob=$(git rev-parse HEAD:f) && - obj=.git/objects/$(echo $blob | cut -c1-2)/$(echo $blob | cut -c3-) && + obj=.git/objects/$(test_oid_to_path $blob) && size=$(wc -c <$obj) && chmod u+w $obj && test_copy_bytes $((size / 2)) <$obj >half && @@ -475,8 +475,9 @@ test_expect_success 'a corrupt blob in a collected diff answers the error' ' ) && cgitrc_repo corruptrc corrupt "repo.path=$PWD/corrupt/.git" && cgit_rc corruptrc "url=corrupt/commit/" >tmp 2>err && - grep "is corrupt" err && - grep "Unable to complete the request" tmp + test $(grep -c "^Status:" tmp) = 1 && + test_grep "<div class=.error.>Unable to complete the request</div>" tmp && + test_grep "is corrupt" err ' # Shells word the failed write differently, and dash names no broken pipe at |
