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 <junkio@cox.net>
Junio C Hamano committed
Feb 25, 2007 at 18:42 UTC
17cd29b25c0f480a3c6e1dd9617d9c6046e3c280
1 file changed
+1
-1
merge-recursive.c
+1
-1
@@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,
589
memcpy(lnk, buf, size);
590
lnk[size] = '\0';
591
mkdir_p(path, 0777);
592
- unlink(lnk);
592
+ unlink(path);
593
symlink(lnk, path);
594
} else
595
die("do not know what to do with %06o %s '%s'",