merge-index: fix longstanding bug in merging symlinks
Ancient commit e2b6a9d0 added code to pass "file modes" from merge-index to merge-one-file, and then later commit 54dd99a1 wanted to make sure we do not end up creating a nonsense symlink that points at a path whose name contains conflict markers. However, nobody noticed that the code in merge-index added by e2b6a9d0 were stripping the S_IFMT bits and the code in 54dd99a1 was meaningless. This fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 25, 2007 at 18:17 UTC
308efc10d890265a4c62a8b58f025aaf8a1f244d
1 file changed
+1
-1
merge-index.c
+1
-1
@@ -60,7 +60,7 @@ static int merge_entry(int pos, const char *path)
60
break;
61
found++;
62
strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
63
- sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT));
63
+ sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
64
arguments[stage] = hexbuf[stage];
65
arguments[stage + 4] = ownbuf[stage];
66
} while (++pos < active_nr);