diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-01-21 16:47:14 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-21 16:47:14 -0800 |
commit | 8318eb795e4bda87d16871ac8ddd5afed033d551 (patch) | |
tree | 41c0ac736ec5b313af7c745449b4cada6215ba4b /t | |
parent | f135e72d611ff6faf3d413a85f1620227d9f0705 (diff) | |
parent | 17f26a9ee3298dfa0a1df7cd4e5f5f32342e5f62 (diff) | |
download | git-8318eb795e4bda87d16871ac8ddd5afed033d551.tar.gz |
Merge branch 'kb/am-directory'
* kb/am-directory:
git-am: fix shell quoting
git-am: add --directory=<dir> option
Diffstat (limited to 't')
-rwxr-xr-x | t/t4252-am-options.sh | 16 | ||||
-rw-r--r-- | t/t4252/am-test-5-1 | 20 | ||||
-rw-r--r-- | t/t4252/am-test-5-2 | 15 |
3 files changed, 51 insertions, 0 deletions
diff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh index 3ab9e8e6e3..5fdd188582 100755 --- a/t/t4252-am-options.sh +++ b/t/t4252-am-options.sh @@ -50,4 +50,20 @@ test_expect_success 'interrupted am -C1 -p2' ' grep "^Three$" file-2 ' +test_expect_success 'interrupted am --directory="frotz nitfol"' ' + rm -rf .git/rebase-apply && + git reset --hard initial && + test_must_fail git am --directory="frotz nitfol" "$tm"/am-test-5-? && + git am --skip && + grep One "frotz nitfol/file-5" +' + +test_expect_success 'apply to a funny path' ' + with_sq="with'\''sq" + rm -fr .git/rebase-apply && + git reset --hard initial && + git am --directory="$with_sq" "$tm"/am-test-5-2 && + test -f "$with_sq/file-5" +' + test_done diff --git a/t/t4252/am-test-5-1 b/t/t4252/am-test-5-1 new file mode 100644 index 0000000000..da7bf29cbe --- /dev/null +++ b/t/t4252/am-test-5-1 @@ -0,0 +1,20 @@ +From: A U Thor <au.thor@example.com> +Date: Thu Dec 4 16:00:00 2008 -0800 +Subject: Six + +Applying this patch with --directory='frotz nitfol' should fail + +diff --git i/junk/file-2 w/junk/file-2 +index 06e567b..b6f3a16 100644 +--- i/junk/file-2 ++++ w/junk/file-2 +@@ -1,7 +1,7 @@ + One + 2 +-3 ++Three + 4 + 5 +-6 ++Six + 7 diff --git a/t/t4252/am-test-5-2 b/t/t4252/am-test-5-2 new file mode 100644 index 0000000000..373025bcf6 --- /dev/null +++ b/t/t4252/am-test-5-2 @@ -0,0 +1,15 @@ +From: A U Thor <au.thor@example.com> +Date: Thu Dec 4 16:00:00 2008 -0800 +Subject: Six + +Applying this patch with --directory='frotz nitfol' should succeed + +diff --git i/file-5 w/file-5 +new file mode 100644 +index 000000..1d6ed9f +--- /dev/null ++++ w/file-5 +@@ -0,0 +1,3 @@ ++One ++two ++three |