{"thread":{"id":"6966","subject":"[PATCH] merge-recursive: fix longstanding bug in merging symlinks","startedAt":"2007-02-26T02:47:40Z","lastAt":"2007-02-26T02:47:40Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35487","messageId":"7vtzx9prcj.fsf@assigned-by-dhcp.cox.net","threadId":"6966","inReplyTo":null,"subject":"[PATCH] merge-recursive: fix longstanding bug in merging symlinks","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-26T02:47:40Z","receivedAt":"2007-02-26T02:47:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Commit 3af244ca added unlink before running symlink to update\nthe working tree with the merge result, but it was unlinking a\nwrong file  This resulted in loss of the path pointed by a\nsymlink.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n * This and the fix to merge-index are meant for maint to be\n   included in 1.5.0.2.\n\n merge-recursive.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 5898942..397a7ad 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,\n \t\t\tmemcpy(lnk, buf, size);\n \t\t\tlnk[size] = '\\0';\n \t\t\tmkdir_p(path, 0777);\n-\t\t\tunlink(lnk);\n+\t\t\tunlink(path);\n \t\t\tsymlink(lnk, path);\n \t\t} else\n \t\t\tdie(\"do not know what to do with %06o %s '%s'\",\n-- \n1.5.0.1.793.gedfd5\n"}]}