From: Junio C Hamano Date: Mon, 26 Feb 2007 02:42:07 +0000 (-0800) Subject: merge-recursive: fix longstanding bug in merging symlinks X-Git-Tag: v1.5.0.2~4^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=17cd29b25c0f480a3c6e1dd9617d9c6046e3c280;p=git.git merge-recursive: fix longstanding bug in merging symlinks Commit 3af244ca added unlink(2) before running symlink(2) to update the working tree with the merge result, but it was unlinking a wrong path. This resulted in loss of the path pointed by a symlink. Signed-off-by: Junio C Hamano --- diff --git a/merge-recursive.c b/merge-recursive.c index 58989424d..397a7ad85 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'",