X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/blobdiff_plain/145fa2143eb508e8c6b36740bd475c23a780cf55..9beaff2e911c0a7c07b288bfdec7597a5cefa7dd:/t/t1300-uncommit.sh diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh index a657ead..d01eaaa 100755 --- a/t/t1300-uncommit.sh +++ b/t/t1300-uncommit.sh @@ -83,4 +83,15 @@ test_expect_success 'Uncommit a commit with not precisely one parent' ' [ "$(echo $(stg series))" = "" ] ' +# stg uncommit should work even when top != head, and should not touch +# the head. +test_expect_failure '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