X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/539fb2921209bd3fd6165baa057f76f474aa5cb4..de8efe1efc4a495eca0614aa9f6c1910d5838f99:/t/t1202-push-undo.sh diff --git a/t/t1202-push-undo.sh b/t/t1202-push-undo.sh index 45dabb4..5afcf68 100755 --- a/t/t1202-push-undo.sh +++ b/t/t1202-push-undo.sh @@ -3,10 +3,10 @@ # Copyright (c) 2006 Catalin Marinas # -test_description='Exercise push --undo with missing files. +test_description='Exercise stg undo with push of missing files. Test the case where a patch fails to be pushed because it modifies a -missing file. The "push --undo" command has to be able to revert it. +missing file. The "stg undo" command has to be able to revert it. ' . ./test-lib.sh @@ -40,17 +40,31 @@ test_expect_success \ stg pop --all ' -test_expect_failure \ +test_expect_success \ 'Push the second patch with conflict' \ ' - stg push bar + conflict stg push bar ' test_expect_success \ 'Undo the previous push' \ ' - stg status --reset && - stg push --undo + stg undo --hard + ' + +test_expect_success \ + 'Check the push after undo fails as well' \ + ' + conflict stg push bar + ' + +test_expect_success \ + 'Undo with disappeared newborn' \ + ' + touch newfile && + stg add newfile && + rm newfile && + stg undo --hard ' test_done