apply: add t4137 for submodule updates
authorJens Lehmann <Jens.Lehmann@web.de>
Sun, 15 Jun 2014 16:59:20 +0000 (18:59 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 19:06:15 +0000 (12:06 -0700)
Test that the apply command updates the work tree as expected for the
'--index' and the '--3way' options (for submodule changes which don't
result in conflicts).

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4137-apply-submodule.sh [new file with mode: 0755]
diff --git a/t/t4137-apply-submodule.sh b/t/t4137-apply-submodule.sh
new file mode 100755 (executable)
index 0000000..a9bd40a
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+test_description='git apply handling submodules'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-submodule-update.sh
+
+apply_index () {
+       git diff --ignore-submodules=dirty "..$1" | git apply --index -
+}
+
+test_submodule_switch "apply_index"
+
+apply_3way () {
+       git diff --ignore-submodules=dirty "..$1" | git apply --3way -
+}
+
+test_submodule_switch "apply_3way"
+
+test_done