]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-fetch-pack.c
replace direct calls to unlink(2) with unlink_or_warn
[git.git] / builtin-fetch-pack.c
index d571253a56c80e0b644b220c870b27726c8f3dfc..bd97cfd9bfdbc6bd25e5364ba84dad44059d2ac4 100644 (file)
@@ -605,7 +605,7 @@ static struct ref *do_fetch_pack(int fd[2],
                        /* When cloning, it is not unusual to have
                         * no common commit.
                         */
-                       fprintf(stderr, "warning: no common commits\n");
+                       warning("no common commits");
 
        if (get_pack(fd, pack_lockfile))
                die("git fetch-pack: fetch failed.");
@@ -814,7 +814,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
                fd = hold_lock_file_for_update(&lock, shallow,
                                               LOCK_DIE_ON_ERROR);
                if (!write_shallow_commits(fd, 0)) {
-                       unlink(shallow);
+                       unlink_or_warn(shallow);
                        rollback_lock_file(&lock);
                } else {
                        commit_lock_file(&lock);