Skip to content

Commit 98f6a3a

Browse files
committed
Merge branch 'ns/fsync-or-die-message-fix'
When creating a loose object file, we didn't report the exact filename of the file we failed to fsync, even though the information was readily available, which has been corrected. * ns/fsync-or-die-message-fix: object-file: pass filename to fsync_or_die
2 parents 27dd460 + c4e707f commit 98f6a3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

object-file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,16 +1888,16 @@ void hash_object_file(const struct git_hash_algo *algo, const void *buf,
18881888
}
18891889

18901890
/* Finalize a file on disk, and close it. */
1891-
static void close_loose_object(int fd)
1891+
static void close_loose_object(int fd, const char *filename)
18921892
{
18931893
if (the_repository->objects->odb->will_destroy)
18941894
goto out;
18951895

18961896
if (fsync_object_files > 0)
1897-
fsync_or_die(fd, "loose object file");
1897+
fsync_or_die(fd, filename);
18981898
else
18991899
fsync_component_or_die(FSYNC_COMPONENT_LOOSE_OBJECT, fd,
1900-
"loose object file");
1900+
filename);
19011901

19021902
out:
19031903
if (close(fd) != 0)
@@ -2011,7 +2011,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,
20112011
die(_("confused by unstable object source data for %s"),
20122012
oid_to_hex(oid));
20132013

2014-
close_loose_object(fd);
2014+
close_loose_object(fd, tmp_file.buf);
20152015

20162016
if (mtime) {
20172017
struct utimbuf utb;

0 commit comments

Comments
 (0)