X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/9b4a6e70a1390d653201e48e12d09005b3fba6c8..a2f4fe7de51cb580ca587d155f01ad569edd36ae:/t/t1300-uncommit.sh diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh index a906d13..4a955f6 100755 --- a/t/t1300-uncommit.sh +++ b/t/t1300-uncommit.sh @@ -79,8 +79,19 @@ test_expect_success \ ' test_expect_success 'Uncommit a commit with not precisely one parent' ' - stg uncommit -n 5 ; [ $? = 2 ] && + command_error stg uncommit -n 5 && [ "$(echo $(stg series))" = "" ] ' +# stg uncommit should work even when top != head, and should not touch +# the head. +test_expect_success 'Uncommit when top != head' ' + stg new -m foo && + git reset --hard HEAD^ && + h=$(git rev-parse HEAD) + stg uncommit bar && + test $(git rev-parse HEAD) = $h && + test "$(echo $(stg series))" = "+ bar > foo" +' + test_done