diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t4151-am-abort.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh index 2a7c5247f9..e61be63114 100755 --- a/t/t4151-am-abort.sh +++ b/t/t4151-am-abort.sh @@ -70,6 +70,17 @@ test_expect_success 'am -3 --skip removes otherfile-4' ' test 4 = "$(cat otherfile-4)" && git am --skip && test_cmp_rev initial HEAD && + test -z "$(git ls-files -u)" && + test_path_is_missing otherfile-4 +' + +test_expect_success 'am -3 --abort removes otherfile-4' ' + git reset --hard initial && + test_must_fail git am -3 0003-*.patch && + test 3 -eq $(git ls-files -u | wc -l) && + test 4 = "$(cat otherfile-4)" && + git am --abort && + test_cmp_rev initial HEAD && test -z $(git ls-files -u) && test_path_is_missing otherfile-4 ' @@ -102,4 +113,16 @@ test_expect_success 'am -3 --skip clears index on unborn branch' ' test_path_is_missing tmpfile ' +test_expect_success 'am -3 --abort removes otherfile-4 on unborn branch' ' + git checkout -f --orphan orphan && + git reset && + rm -f otherfile-4 file-1 && + test_must_fail git am -3 0003-*.patch && + test 2 -eq $(git ls-files -u | wc -l) && + test 4 = "$(cat otherfile-4)" && + git am --abort && + test -z "$(git ls-files -u)" && + test_path_is_missing otherfile-4 +' + test_done |