summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2014-06-15 17:03:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-14 19:06:16 (GMT)
commit23e2f388c7da3cfe72c880e662dafb0c2965abba (patch)
treecdd256c917f776d24aabf88dab547e1f4f17d0f6 /t
parent283f56a40bd9538d7277bb866526d5cae4494eec (diff)
downloadgit-23e2f388c7da3cfe72c880e662dafb0c2965abba.zip
git-23e2f388c7da3cfe72c880e662dafb0c2965abba.tar.gz
git-23e2f388c7da3cfe72c880e662dafb0c2965abba.tar.bz2
am: add t4255 for submodule updates
Test that the am command updates the work tree as expected (for submodule changes which don't result in conflicts). To make that work add two helper functions that use format-patch to create the input for am. Add the KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES switch to expect the known failure that --no-ff merges attempt to merge the new files in the former submodule directory with those of the removed submodule. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4255-am-submodule.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t4255-am-submodule.sh b/t/t4255-am-submodule.sh
new file mode 100755
index 0000000..8bde7db
--- /dev/null
+++ b/t/t4255-am-submodule.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+test_description='git am handling submodules'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-submodule-update.sh
+
+am () {
+ git format-patch --stdout --ignore-submodules=dirty "..$1" | git am -
+}
+
+test_submodule_switch "am"
+
+am_3way () {
+ git format-patch --stdout --ignore-submodules=dirty "..$1" | git am --3way -
+}
+
+KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
+test_submodule_switch "am_3way"
+
+test_done