]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-apply.c
Merge branch 'jk/no-no-no-empty-directory'
[git.git] / builtin-apply.c
index 7b404ef6601e5b7820e9b1b6812225639e3ea4b1..8a3771e87e1ef2ac7a1ee70133b8206f0f18cbb5 100644 (file)
@@ -2781,7 +2781,7 @@ static void remove_file(struct patch *patch, int rmdir_empty)
                        if (rmdir(patch->old_name))
                                warning("unable to remove submodule %s",
                                        patch->old_name);
-               } else if (!unlink(patch->old_name) && rmdir_empty) {
+               } else if (!unlink_or_warn(patch->old_name) && rmdir_empty) {
                        remove_path(patch->old_name);
                }
        }
@@ -2891,7 +2891,7 @@ static void create_one_file(char *path, unsigned mode, const char *buf, unsigned
                        if (!try_create_file(newpath, mode, buf, size)) {
                                if (!rename(newpath, path))
                                        return;
-                               unlink(newpath);
+                               unlink_or_warn(newpath);
                                break;
                        }
                        if (errno != EEXIST)