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>
Jens Lehmann committed
Jun 15, 2014 at 19:03 UTC
23e2f388c7da3cfe72c880e662dafb0c2965abba
1 file changed
+21
t/t4255-am-submodule.sh
new
+21
@@ -0,0 +1,21 @@
1
+#!/bin/sh
2
+
3
+test_description='git am handling submodules'
4
+
5
+. ./test-lib.sh
6
+. "$TEST_DIRECTORY"/lib-submodule-update.sh
7
+
8
+am () {
9
+ git format-patch --stdout --ignore-submodules=dirty "..$1" | git am -
10
+}
11
+
12
+test_submodule_switch "am"
13
+
14
+am_3way () {
15
+ git format-patch --stdout --ignore-submodules=dirty "..$1" | git am --3way -
16
+}
17
+
18
+KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
19
+test_submodule_switch "am_3way"
20
+
21
+test_done