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

[PATCH] merge-recursive: fix longstanding bug in merging symlinks

From
Junio C Hamano <junkio@cox.net>
Date
Feb 26, 2007, 02:47 UTC
Message-ID
<7vtzx9prcj.fsf@assigned-by-dhcp.cox.net>

Commit 3af244ca added unlink before running symlink to update the working tree with the merge result, but it was unlinking a wrong file This resulted in loss of the path pointed by a symlink.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * This and the fix to merge-index are meant for maint to be
   included in 1.5.0.2.
 merge-recursive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 5898942..397a7ad 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,
 			memcpy(lnk, buf, size);
 			lnk[size] = '\0';
 			mkdir_p(path, 0777);
-			unlink(lnk);
+			unlink(path);
 			symlink(lnk, path);
 		} else
 			die("do not know what to do with %06o %s '%s'",
-- 
1.5.0.1.793.gedfd5
Message 1 of 1 in “merge-recursive: fix longstanding bug in merging symlinks”
  1. merge-recursive: fix longstanding bug in merging symlinksJunio C Hamano, Feb 26, 2007

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.