{"thread":{"id":"6171","subject":"[PATCH] Refresh the index before starting merge-recursive.","startedAt":"2006-12-31T05:02:13Z","lastAt":"2006-12-31T05:02:13Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"30549","messageId":"20061231050213.GA6008@spearce.org","threadId":"6171","inReplyTo":null,"subject":"[PATCH] Refresh the index before starting merge-recursive.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-31T05:02:13Z","receivedAt":"2006-12-31T05:02:13Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Since merge-recursive won't perform a refresh of stale stat data on\nits own we need to make sure we run `update-index --refresh` prior\nto starting it, otherwise stale stat data may cause an otherwise\nvalid merge to fail.\n\nThis was simply a thinko on my part when I reorganized this section\nof code.  Silly copy and paste error and all....\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n Applies to the top of my sp/merge topic.\n\n git-merge.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 922c5b8..ced5524 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -296,6 +296,7 @@ f,*)\n ?,1,*,)\n \t# We are not doing octopus, not fast forward, and have only\n \t# one common.  See if it is really trivial.\n+\tgit-update-index --refresh 2>/dev/null\n \tcase \"$use_strategies\" in\n \trecursive|'recursive '|recur|'recur ')\n \t\t: run merge later\n@@ -303,7 +304,6 @@ f,*)\n \t*)\n \t\tgit var GIT_COMMITTER_IDENT >/dev/null || exit\n \t\techo \"Trying really trivial in-index merge...\"\n-\t\tgit-update-index --refresh 2>/dev/null\n \t\tif git-read-tree --trivial -m -u -v $common $head \"$1\" &&\n \t\t   result_tree=$(git-write-tree)\n \t\tthen\n-- \n1.5.0.rc0.g6bb1\n"}]}