]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/apply.c
Merge branch 'maint-1.7.0' into maint-1.7.1
[thirdparty/git.git] / builtin / apply.c
index f669157b42e658b3769ec775f7aa4dafea634db8..59bbcdb1323cb70432e90ccc2d6a1c60a562c706 100644 (file)
@@ -3141,11 +3141,7 @@ static void remove_file(struct patch *patch, int rmdir_empty)
                        die("unable to remove %s from index", patch->old_name);
        }
        if (!cached) {
-               if (S_ISGITLINK(patch->old_mode)) {
-                       if (rmdir(patch->old_name))
-                               warning("unable to remove submodule %s",
-                                       patch->old_name);
-               } else if (!unlink_or_warn(patch->old_name) && rmdir_empty) {
+               if (!remove_or_warn(patch->old_mode, patch->old_name) && rmdir_empty) {
                        remove_path(patch->old_name);
                }
        }