git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 4/4] apply: add t4137 for submodule updates

From
Jens Lehmann <jens.lehmann@web.de>
Date
Mar 25, 2014, 17:06 UTC
Message-ID
<5331B779.3050306@web.de>
In-Reply-To
<5331B6F6.60501@web.de>

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>
---

And this shows how to use the new framework when more than a single command is needed to switch to a new work tree.

 t/t4137-apply-submodule.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 t/t4137-apply-submodule.sh
diff --git a/t/t4137-apply-submodule.sh b/t/t4137-apply-submodule.sh
new file mode 100755
index 0000000..f0a0500
--- /dev/null
+++ b/t/t4137-apply-submodule.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+test_description='git am 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
-- 
1.9.1.327.g3d8d896
Previous: Jens Lehmann
Message 17 of 17 in “Add submodule test harness”
  1. 0/4 Add submodule test harnessJens Lehmann, Mar 25, 2014
  2. 1/4 test-lib: add test_dir_is_empty()Jens Lehmann, Mar 25, 2014
  3. Junio C HamanoMar 25, 2014
  4. David KastrupMar 25, 2014
  5. Jens LehmannMar 26, 2014
  6. Michael HaggertyMar 26, 2014
  7. Jens LehmannMar 26, 2014
  8. 2/4 Submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Mar 25, 2014
  9. W. Trevor KingApr 17, 2014
  10. Junio C HamanoApr 17, 2014
  11. Jens LehmannApr 17, 2014
  12. Heiko VoigtApr 18, 2014
  13. Jens LehmannApr 17, 2014
  14. W. Trevor KingApr 17, 2014
  15. Jens LehmannApr 18, 2014
  16. 3/4 checkout: call the new submodule update test frameworkJens Lehmann, Mar 25, 2014
  17. 4/4 apply: add t4137 for submodule updatesJens Lehmann, Mar 25, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.