Diff options
| -rwxr-xr-x | tests/t0303-robustness.sh | 22 |
1 file changed, 14 insertions, 8 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 9ae0347..34c0f22 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -430,19 +430,25 @@ test_expect_success 'a die inside git answers one 500 page and logs the reason' ! grep "bad config line" tmp ' -test_expect_success 'a history with a missing parent renders up to the gap' ' - git clone -q repos/rob gap && - older=$(git -C gap rev-parse HEAD~3) && - parent=$(git -C gap rev-parse HEAD~2) && - rm gap/.git/objects/$(echo $parent | cut -c1-2)/$(echo $parent | cut -c3-) && +# The log walks the history before it prints a row, so a missing commit ends +# the page before any of it, and the reason goes to the log alone. +test_expect_success 'a history with a missing parent answers one error' ' + test_create_repo gap && + test_commit -C gap --no-tag first && + test_commit -C gap --no-tag second && + test_commit -C gap --no-tag third && + older=$(git -C gap rev-parse HEAD~2) && + parent=$(git -C gap rev-parse HEAD~1) && + tip=$(git -C gap rev-parse HEAD) && + rm "gap/.git/objects/$(test_oid_to_path $parent)" && cgitrc_repo gaprc gap "repo.path=$PWD/gap/.git" && cgit_rc gaprc "url=gap/log/" >tmp 2>err && test $(grep -c "^Status:" tmp) = 1 && - grep "Unable to complete the request" tmp && - grep "Failed to traverse parents" err && + test_grep "<div class=.error.>Unable to complete the request</div>" tmp && + test_grep "Failed to traverse parents of commit $tip" err && cgit_rc gaprc "url=gap/patch/&id2=$older" >tmp && test $(grep -c "^Status:" tmp) = 1 && - grep "^Status: 500" tmp + test_grep "^Status: 500" tmp ' # The commit page collects each file's diff body before printing it, so a |
