diff --git a/merge-recursive.c b/merge-recursive.c
index 87cd8709bbc99db559f3892c048ec111673a2566..c96e1a734cb0c258cd4adb4f00e247abdf804640 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
if (type != OBJ_BLOB)
die("blob expected for %s '%s'", sha1_to_hex(sha), path);
if (type != OBJ_BLOB)
die("blob expected for %s '%s'", sha1_to_hex(sha), path);
- if (S_ISREG(mode)) {
+ if (S_ISREG(mode) || (!has_symlinks && S_ISLNK(mode))) {
int fd;
if (mkdir_p(path, 0777))
die("failed to create path %s: %s", path, strerror(errno));
int fd;
if (mkdir_p(path, 0777))
die("failed to create path %s: %s", path, strerror(errno));
mkdir_p(path, 0777);
unlink(path);
symlink(lnk, path);
mkdir_p(path, 0777);
unlink(path);
symlink(lnk, path);
+ free(lnk);
} else
die("do not know what to do with %06o %s '%s'",
mode, sha1_to_hex(sha), path);
} else
die("do not know what to do with %06o %s '%s'",
mode, sha1_to_hex(sha), path);