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

[PATCH] Add a new test to ensure merging a submodule is handled properly.

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Aug 11, 2008, 20:48 UTC
Message-ID
<1218487680-7933-1-git-send-email-vmiklos@frugalware.org>
In-Reply-To
<20080811204511.GV18960@genesis.frugalware.org>

In this test we cause a directory / submodule conflict then we check if the index is unlocked properly.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

I'm no exactly sure if this should be included or not, I just wrote it to make sure that a die() insure merge-recursive will not cause an unlocked index at the end.

 t/t7607-merge-submodule.sh |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100755 t/t7607-merge-submodule.sh
diff --git a/t/t7607-merge-submodule.sh b/t/t7607-merge-submodule.sh
new file mode 100755
index 0000000..552930a
--- /dev/null
+++ b/t/t7607-merge-submodule.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+test_description='git-merge
+
+Testing if a directory / submodule conflict is handled properly.'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	mkdir lib &&
+	cd lib &&
+	git init &&
+	echo c1 >c1.c &&
+	git add c1.c &&
+	git commit -m "submodule init" &&
+	mkdir ../main &&
+	cd ../main &&
+	git init &&
+	echo main >main.c &&
+	git add main.c &&
+	git commit -m "c0: main init" &&
+	git tag c0 &&
+	mkdir lib &&
+	echo lib >lib/c1.c &&
+	git add lib/c1.c &&
+	git commit -m "c1: lib init" &&
+	git tag c1 &&
+	git reset --hard c0 &&
+	git submodule add "`pwd`/../lib" lib &&
+	git commit -m "c2: add submodule" &&
+	git tag c2
+'
+
+test_expect_success 'dir/submodule conflict' '
+	git reset --hard c1 &&
+	test_must_fail git merge c2 &&
+	test ! -f .git/index.lock
+'
+
+test_done
-- 
1.6.0.rc0.14.g95f8.dirty
Previous: Miklos VajnaNext: Stephan Beyer
Message 8 of 38 in “Avoid run_command() for recursive in builtin-merge”
  1. 0/2 Avoid run_command() for recursive in builtin-mergeMiklos Vajna, Aug 10, 2008
  2. 1/2 merge-recursive: prepare merge_recursive() to be called from builtinsMiklos Vajna, Aug 10, 2008
  3. 2/2 builtin-merge: avoid run_command_v_opt() for recursiveMiklos Vajna, Aug 10, 2008
  4. Junio C HamanoAug 11, 2008
  5. Miklos VajnaAug 11, 2008
  6. Junio C HamanoAug 11, 2008
  7. Miklos VajnaAug 11, 2008
  8. Add a new test to ensure merging a submodule is handled properly.Miklos Vajna, Aug 11, 2008
  9. Stephan BeyerAug 11, 2008
  10. Miklos VajnaAug 11, 2008
  11. Junio C HamanoAug 11, 2008
  12. Stephan BeyerAug 11, 2008
  13. builtin-revert.c: Make use of merge_recursive()Stephan Beyer, Aug 11, 2008
  14. Johannes SchindelinAug 11, 2008
  15. Stephan BeyerAug 11, 2008
  16. Miklos VajnaAug 11, 2008
  17. builtin-revert: Make use of merge_recursive()Stephan Beyer, Aug 11, 2008
  18. Stephan BeyerAug 11, 2008
  19. Junio C HamanoAug 11, 2008
  20. Junio C HamanoAug 11, 2008
  21. Stephan BeyerAug 11, 2008
  22. Junio C HamanoAug 11, 2008
  23. Split out merge_recursive() to merge-recursive.cMiklos Vajna, Aug 12, 2008
  24. Stephan BeyerAug 12, 2008
  25. Miklos VajnaAug 12, 2008
  26. merge-recursive.c: Add more generic merge_recursive_generic()Stephan Beyer, Aug 12, 2008
  27. Make builtin-revert.c use merge_recursive_generic()Stephan Beyer, Aug 12, 2008
  28. Miklos VajnaAug 12, 2008
  29. Stephan BeyerAug 13, 2008
  30. Miklos VajnaAug 13, 2008
  31. Daniel BarkalowAug 13, 2008
  32. Stephan BeyerAug 13, 2008
  33. Daniel BarkalowAug 13, 2008
  34. Junio C HamanoAug 13, 2008
  35. Stephan BeyerAug 13, 2008
  36. Daniel BarkalowAug 13, 2008
  37. Junio C HamanoAug 13, 2008
  38. Junio C HamanoAug 14, 2008

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.