Skip to content

Commit

Permalink
merge-recursive: fix longstanding bug in merging symlinks
Browse files Browse the repository at this point in the history
Commit 3af244c 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>
  • Loading branch information
Junio C Hamano committed Feb 26, 2007
1 parent 308efc1 commit 17cd29b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down

0 comments on commit 17cd29b

Please sign in to comment.