1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-26 11:46:12 +02:00

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>
This commit is contained in:
Junio C Hamano 2007-02-25 18:42:07 -08:00
parent 308efc10d8
commit 17cd29b25c

View File

@ -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'",