git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] merge-index: fix longstanding bug in merging symlinks

From
Junio C Hamano <junkio@cox.net>
Date
Feb 26, 2007, 02:46 UTC
Message-ID
<7vy7mlpret.fsf@assigned-by-dhcp.cox.net>

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 that the code in merge-index added by e2b6a9d0 were stripping the S_IFMT bits so the code in 54dd99a1 was meaningless.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 merge-index.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/merge-index.c b/merge-index.c
index a9983dd..7027d78 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);
-- 
1.5.0.1.793.gedfd5
Message 1 of 1 in “merge-index: fix longstanding bug in merging symlinks”
  1. merge-index: fix longstanding bug in merging symlinksJunio C Hamano, Feb 26, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.