Merge branch 'mh/avoid-rewriting-packed-refs' into maint
[gitweb.git] / builtin / unpack-file.c
index 281ca1db6ce13ddb4cc227ebb7ea454176e8e9e1..32e01555774c838e489fd33c675488e754c3e8e2 100644 (file)
@@ -15,7 +15,7 @@ static char *create_temp_file(struct object_id *oid)
 
        xsnprintf(path, sizeof(path), ".merge_file_XXXXXX");
        fd = xmkstemp(path);
-       if (write_in_full(fd, buf, size) != size)
+       if (write_in_full(fd, buf, size) < 0)
                die_errno("unable to write temp-file");
        close(fd);
        return path;