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

[PATCH] Refresh the index before starting merge-recursive.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 31, 2006, 05:02 UTC
Message-ID
<20061231050213.GA6008@spearce.org>

Since merge-recursive won't perform a refresh of stale stat data on its own we need to make sure we run `update-index --refresh` prior to starting it, otherwise stale stat data may cause an otherwise valid merge to fail.

This was simply a thinko on my part when I reorganized this section of code. Silly copy and paste error and all....

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 Applies to the top of my sp/merge topic.
 git-merge.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-merge.sh b/git-merge.sh
index 922c5b8..ced5524 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -296,6 +296,7 @@ f,*)
 ?,1,*,)
 	# We are not doing octopus, not fast forward, and have only
 	# one common.  See if it is really trivial.
+	git-update-index --refresh 2>/dev/null
 	case "$use_strategies" in
 	recursive|'recursive '|recur|'recur ')
 		: run merge later
@@ -303,7 +304,6 @@ f,*)
 	*)
 		git var GIT_COMMITTER_IDENT >/dev/null || exit
 		echo "Trying really trivial in-index merge..."
-		git-update-index --refresh 2>/dev/null
 		if git-read-tree --trivial -m -u -v $common $head "$1" &&
 		   result_tree=$(git-write-tree)
 		then
-- 
1.5.0.rc0.g6bb1
Message 1 of 1 in “Refresh the index before starting merge-recursive.”
  1. Refresh the index before starting merge-recursive.Shawn O. Pearce, Dec 31, 2006

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.