summaryrefslogtreecommitdiff
path: root/merge-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-25 18:17:15 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-25 19:08:48 -0800
commit308efc10d890265a4c62a8b58f025aaf8a1f244d (patch)
tree62a546ee00f3364805a7ab036d8845fd259ed6fc /merge-index.c
parent437b1b20df4b356c9342dac8d38849f24ef44f27 (diff)
downloadgit-308efc10d890265a4c62a8b58f025aaf8a1f244d.tar.gz
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>
Diffstat (limited to 'merge-index.c')
-rw-r--r--merge-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/merge-index.c b/merge-index.c
index a9983dd78a..7027d78659 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -60,7 +60,7 @@ static int merge_entry(int pos, const char *path)
break;
found++;
strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
- sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT));
+ sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
arguments[stage] = hexbuf[stage];
arguments[stage + 4] = ownbuf[stage];
} while (++pos < active_nr);