Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-22 03:47:14 +0300
committerJunio C Hamano <gitster@pobox.com>2009-01-22 03:47:14 +0300
commit8318eb795e4bda87d16871ac8ddd5afed033d551 (patch)
tree41c0ac736ec5b313af7c745449b4cada6215ba4b /t
parentf135e72d611ff6faf3d413a85f1620227d9f0705 (diff)
parent17f26a9ee3298dfa0a1df7cd4e5f5f32342e5f62 (diff)
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-xt/t4252-am-options.sh16
-rw-r--r--t/t4252/am-test-5-120
-rw-r--r--t/t4252/am-test-5-215
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