diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-12-04 17:08:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-04 18:45:02 -0800 |
commit | fe6beab7e80565dac81125aa82521f7673905ebc (patch) | |
tree | bc814ba85441b34b519ec6a0631b37e51ea7de50 /t/t4252-am-options.sh | |
parent | 22db240dd1791b32e7f6d25a466c2835bdccb51e (diff) | |
download | git-fe6beab7e80565dac81125aa82521f7673905ebc.tar.gz |
Test that git-am does not lose -C/-p/--whitespace options
These tests make sure that "git am" does not lose command line options
specified when it was started, after it is interrupted by a patch that
does not apply earlier in the series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4252-am-options.sh')
-rwxr-xr-x | t/t4252-am-options.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh new file mode 100755 index 0000000000..1a1946dd97 --- /dev/null +++ b/t/t4252-am-options.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +test_description='git am not losing options' +. ./test-lib.sh + +tm="$TEST_DIRECTORY/t4252" + +test_expect_success setup ' + cp "$tm/file-1-0" file-1 && + cp "$tm/file-2-0" file-2 && + git add file-1 file-2 && + test_tick && + git commit -m initial && + git tag initial +' + +test_expect_success 'interrupted am --whitespace=fix' ' + rm -rf .git/rebase-apply && + git reset --hard initial && + test_must_fail git am --whitespace=fix "$tm"/am-test-1-? && + git am --skip && + grep 3 file-1 && + grep "^Six$" file-2 +' + +test_expect_success 'interrupted am -C1' ' + rm -rf .git/rebase-apply && + git reset --hard initial && + test_must_fail git am -C1 "$tm"/am-test-2-? && + git am --skip && + grep 3 file-1 && + grep "^Three$" file-2 +' + +test_expect_success 'interrupted am -p2' ' + rm -rf .git/rebase-apply && + git reset --hard initial && + test_must_fail git am -p2 "$tm"/am-test-3-? && + git am --skip && + grep 3 file-1 && + grep "^Three$" file-2 +' + +test_expect_success 'interrupted am -C1 -p2' ' + rm -rf .git/rebase-apply && + git reset --hard initial && + test_must_fail git am -p2 -C1 "$tm"/am-test-4-? && + cat .git/rebase-apply/apply_opt_extra && + git am --skip && + grep 3 file-1 && + grep "^Three$" file-2 +' + +test_done |