X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-merge-one-file.sh;h=e1eb9632660146396a0b5f3f2a410d8cb027ff9d;hb=e0e03a731b2d06f42e79a2ff156ef9bd0e5c6c02;hp=9ee3f804520eadb322de3d0ea70a2bf9f092b089;hpb=887ad79865d862a0a3aef4b59957d7dd95d0507d;p=git.git diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index 9ee3f8045..e1eb96326 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -48,10 +48,11 @@ case "${1:-.}${2:-.}${3:-.}" in ;; "..$3") echo "Adding $4" - test -f "$4" || { + if test -f "$4" + then echo "ERROR: untracked $4 is overwritten by the merge." exit 1 - } + fi git update-index --add --cacheinfo "$7" "$3" "$4" && exec git checkout-index -u -f -- "$4" ;;