{"thread":{"id":"6965","subject":"[PATCH] merge-index: fix longstanding bug in merging symlinks","startedAt":"2007-02-26T02:46:18Z","lastAt":"2007-02-26T02:46:18Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35486","messageId":"7vy7mlpret.fsf@assigned-by-dhcp.cox.net","threadId":"6965","inReplyTo":null,"subject":"[PATCH] merge-index: fix longstanding bug in merging symlinks","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-26T02:46:18Z","receivedAt":"2007-02-26T02:46:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ancient commit e2b6a9d0 added code to pass \"file modes\" from\nmerge-index to merge-one-file, and then later commit 54dd99a1\nwanted to make sure we do not end up creating a nonsense symlink\nthat points at a path whose name contains conflict markers.\n\nHowever, nobody that the code in merge-index added by e2b6a9d0\nwere stripping the S_IFMT bits so the code in 54dd99a1 was\nmeaningless.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n merge-index.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/merge-index.c b/merge-index.c\nindex a9983dd..7027d78 100644\n--- a/merge-index.c\n+++ b/merge-index.c\n@@ -60,7 +60,7 @@ static int merge_entry(int pos, const char *path)\n \t\t\tbreak;\n \t\tfound++;\n \t\tstrcpy(hexbuf[stage], sha1_to_hex(ce->sha1));\n-\t\tsprintf(ownbuf[stage], \"%o\", ntohl(ce->ce_mode) & (~S_IFMT));\n+\t\tsprintf(ownbuf[stage], \"%o\", ntohl(ce->ce_mode));\n \t\targuments[stage] = hexbuf[stage];\n \t\targuments[stage + 4] = ownbuf[stage];\n \t} while (++pos < active_nr);\n-- \n1.5.0.1.793.gedfd5\n"}]}