rebase: one safety net, one bugfix and one optimization.
[gitweb.git] / git-merge-one-file.sh
index b285990fb24f8a2a3dc96e27af67b6afbac024c7..c3eca8b3321df8dbf632fb687003737d8989d6f6 100755 (executable)
@@ -26,11 +26,7 @@ case "${1:-.}${2:-.}${3:-.}" in
        fi
        if test -f "$4"; then
                rm -f -- "$4" &&
-               dn="$4" &&
-               while dn=$(expr "$dn" : '\(.*\)/') && rmdir "$dn" 2>/dev/null
-               do
-                       :;
-               done
+               rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
        fi &&
                exec git-update-index --remove -- "$4"
        ;;