ls-remote: define die() now we do not use git-sh-setup
[gitweb.git] / git-merge-one-file.sh
index b08597de29afc6bc1aaddf7b817bc122cd517b04..c3eca8b3321df8dbf632fb687003737d8989d6f6 100755 (executable)
@@ -25,7 +25,8 @@ case "${1:-.}${2:-.}${3:-.}" in
                echo "Removing $4"
        fi
        if test -f "$4"; then
-               rm -f -- "$4"
+               rm -f -- "$4" &&
+               rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
        fi &&
                exec git-update-index --remove -- "$4"
        ;;