]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tempfile.c
submodule: make zero-oid comparison hash function agnostic
[thirdparty/git.git] / tempfile.c
index 139ecd97f8eb88b597aab50c2eb2b171a11ef3ef..d43ad8c1912d977183270fabe7ac76c5bbb7a1a3 100644 (file)
@@ -279,7 +279,7 @@ int reopen_tempfile(struct tempfile *tempfile)
                BUG("reopen_tempfile called for an inactive object");
        if (0 <= tempfile->fd)
                BUG("reopen_tempfile called for an open object");
-       tempfile->fd = open(tempfile->filename.buf, O_WRONLY);
+       tempfile->fd = open(tempfile->filename.buf, O_WRONLY|O_TRUNC);
        return tempfile->fd;
 }