Implement git remote rename
[gitweb.git] / git-merge-one-file.sh
index 1e7727d2763e744b94f55c2056eccaab12367c9e..e1eb9632660146396a0b5f3f2a410d8cb027ff9d 100755 (executable)
@@ -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"
        ;;
@@ -80,6 +81,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`