tempfile: do not delete tempfile on failed close
[git/git.git] / shallow.c
index f49e6ae..36216fe 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -296,7 +296,7 @@ const char *setup_temporary_shallow(const struct oid_array *extra)
                fd = xmks_tempfile(&temp, git_path("shallow_XXXXXX"));
 
                if (write_in_full(fd, sb.buf, sb.len) != sb.len ||
-                   close_tempfile(&temp) < 0)
+                   close_tempfile_gently(&temp) < 0)
                        die_errno("failed to write to %s",
                                  get_tempfile_path(&temp));
                strbuf_release(&sb);