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

[PATCH 2/2] Demonstrate merge failure when a directory is replaced with a symlink.

From
JPJames Pickens <james.e.pickens@intel.com>
Date
Jul 28, 2009, 22:13 UTC
Message-ID
<1248819198-13921-3-git-send-email-james.e.pickens@intel.com>
In-Reply-To
<1248819198-13921-2-git-send-email-james.e.pickens@intel.com>

This test creates two directories, a/b and a/b-2, replaces a/b-2 with a symlink to a/b, then merges that change into another branch that contains unrelated changes. Since the changes are unrelated, the merge should be free of conflicts, but 'git merge' gives a file/directory conflict.

Note that this test is almost identical to t6035, except that instead of replacing a/b with a symlink, it replaces a/b-2 with a symlink. This test results in a merge conflict, whereas t6035 does not.

Signed-off-by: James Pickens <james.e.pickens@intel.com>
---
 t/t6036-merge-dir-to-symlink.sh |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100755 t/t6036-merge-dir-to-symlink.sh
diff --git a/t/t6036-merge-dir-to-symlink.sh b/t/t6036-merge-dir-to-symlink.sh
new file mode 100755
index 0000000..020db7c
--- /dev/null
+++ b/t/t6036-merge-dir-to-symlink.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='merging when a directory was replaced with a symlink'
+. ./test-lib.sh
+
+test_expect_success setup '
+	mkdir -p a/b/c a/b-2/c &&
+	> a/b/c/d &&
+	> a/b-2/c/d &&
+	> a/x &&
+	git add -A &&
+	git commit -m base &&
+	rm -rf a/b-2 &&
+	ln -s b a/b-2 &&
+	git add -A &&
+	git commit -m "dir to symlink"
+'
+
+test_expect_failure 'checkout should not delete a/b/c/d' '
+	git checkout -b temp HEAD^ &&
+	test -f a/b/c/d
+'
+
+test_expect_failure 'merge should not have conflicts' '
+	echo x > a/x &&
+	git add a/x &&
+	git commit -m x &&
+	git merge master'
+
+test_done
-- 
1.6.2.5.1
Previous: James PickensNext: Michael J Gruber
Message 3 of 18 in “More symlink/directory troubles”
  1. James PickensJul 28, 2009
  2. 1/2 Demonstrate bugs when a directory is replaced with a symlink.James Pickens, Jul 28, 2009
  3. 2/2 Demonstrate merge failure when a directory is replaced with a symlink.James Pickens, Jul 28, 2009
  4. Michael J GruberJul 29, 2009
  5. Pickens, James EJul 29, 2009
  6. Michael J GruberJul 29, 2009
  7. Junio C HamanoJul 29, 2009
  8. Pickens, James EJul 29, 2009
  9. Demonstrate bugs when a directory is replaced with a symlinkPickens, James E, Jul 29, 2009
  10. Junio C HamanoJul 29, 2009
  11. Demonstrate bugs when a directory is replaced with a symlinkPickens, James E, Jul 29, 2009
  12. Linus TorvaldsJul 29, 2009
  13. Junio C HamanoJul 29, 2009
  14. Kjetil BarvikJul 29, 2009
  15. Linus TorvaldsJul 29, 2009
  16. Linus TorvaldsJul 30, 2009
  17. Junio C HamanoJul 30, 2009
  18. Junio C HamanoJul 30, 2009

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.