Skip to content

Commit 354b9b5

Browse files
Linus TorvaldsJunio C Hamano
authored andcommitted
merge-one-file: leave unmerged index entries upon automerge failure.
When automerge fails, we used to collapse the path to stage0 from "our" branch, to help "diff-files" users to view the half-merged state against the current HEAD. Now diff-files has been taught how to compare with unmerged stage2,leaving them unmerged is a better thing to do, especially this prevents the unresolved conflicts to be committed by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 10637b8 commit 354b9b5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

git-merge-one-file.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ case "${1:-.}${2:-.}${3:-.}" in
7979
;;
8080
esac
8181

82-
# We reset the index to the first branch, making
83-
# git-diff-file useful
84-
git-update-index --add --cacheinfo "$6" "$2" "$4"
85-
git-checkout-index -u -f -- "$4" &&
86-
merge "$4" "$orig" "$src2"
82+
merge "$4" "$orig" "$src2"
8783
ret=$?
8884
rm -f -- "$orig" "$src2"
8985

0 commit comments

Comments
 (0)