X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-merge-one-file.sh;h=9ee3f804520eadb322de3d0ea70a2bf9f092b089;hb=d1b28f512c6d2c7d373c746d8876dbf177ddf114;hp=ebbb5759652c58916e5066f9f4f3f842d0c44492;hpb=e2b1accc59ab5d682d71fd801ebe959c3e871488;p=git.git diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index ebbb57596..9ee3f8045 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -27,8 +27,9 @@ case "${1:-.}${2:-.}${3:-.}" in # read-tree checked that index matches HEAD already, # so we know we do not have this path tracked. # there may be an unrelated working tree file here, - # which we should just leave unmolested. - exit 0 + # which we should just leave unmolested. Make sure + # we do not have it in the index, though. + exec git update-index --remove -- "$4" fi if test -f "$4"; then rm -f -- "$4" && @@ -42,7 +43,8 @@ case "${1:-.}${2:-.}${3:-.}" in # ".$2.") # the other side did not add and we added so there is nothing - # to be done. + # to be done, except making the path merged. + exec git update-index --add --cacheinfo "$6" "$2" "$4" ;; "..$3") echo "Adding $4" @@ -50,7 +52,7 @@ case "${1:-.}${2:-.}${3:-.}" in echo "ERROR: untracked $4 is overwritten by the merge." exit 1 } - git update-index --add --cacheinfo "$6$7" "$2$3" "$4" && + git update-index --add --cacheinfo "$7" "$3" "$4" && exec git checkout-index -u -f -- "$4" ;; @@ -78,6 +80,10 @@ case "${1:-.}${2:-.}${3:-.}" in echo "ERROR: $4: Not merging symbolic link changes." exit 1 ;; + *,160000,*) + echo "ERROR: $4: Not merging conflicting submodule changes." + exit 1 + ;; esac src2=`git-unpack-file $3`