Skip to content

Commit

Permalink
merge-index: fix longstanding bug in merging symlinks
Browse files Browse the repository at this point in the history
Ancient commit e2b6a9d added code to pass "file modes" from
merge-index to merge-one-file, and then later commit 54dd99a
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
e2b6a9d were stripping the S_IFMT bits and the code in 54dd99a
was meaningless.  This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Feb 26, 2007
1 parent 437b1b2 commit 308efc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merge-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 308efc1

Please sign in to comment.