summaryrefslogtreecommitdiff
path: root/git-merge-one-file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-merge-one-file.sh')
-rwxr-xr-xgit-merge-one-file.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 9ee3f80452..e1eb963266 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"
;;