X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/blobdiff_plain/980bde6a6c5b9a4a5cae0d8f7b863e477737a8f3..a2f4fe7de51cb580ca587d155f01ad569edd36ae:/t/t1300-uncommit.sh diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh index d86e579..4a955f6 100755 --- a/t/t1300-uncommit.sh +++ b/t/t1300-uncommit.sh @@ -78,4 +78,20 @@ test_expect_success \ stg commit --all ' +test_expect_success 'Uncommit a commit with not precisely one parent' ' + 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