Skip to contentSkip to conversation

merge-recursive: fix longstanding bug in merging symlinks

PATCH New Junio C Hamano 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 merge-recursive: fix longstanding bug in merging symlinks

Commit 3af244ca added unlink before running symlink to update the working tree with the merge result, but it was unlinking a wrong file This resulted in loss of the path pointed by a symlink.

---
* This and the fix to merge-index are meant for maint to be included in 1.5.0.2.

 merge-recursive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
merge-recursive.c +1 -1
index 5898942..397a7ad 100644
@@ -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'",
Signature · 1 line
1.5.0.1.793.gedfd5