mirror of
https://github.com/git/git
synced 2024-10-30 13:20:15 +00:00
Merge branch 'jc/maint-fsck-fwrite-size-check' into maint
* jc/maint-fsck-fwrite-size-check: fsck: do not abort upon finding an empty blob
This commit is contained in:
commit
d7b7dd3849
1 changed files with 3 additions and 6 deletions
|
@ -231,12 +231,9 @@ static void check_unreachable_object(struct object *obj)
|
|||
unsigned long size;
|
||||
char *buf = read_sha1_file(obj->sha1,
|
||||
&type, &size);
|
||||
if (buf) {
|
||||
if (fwrite(buf, size, 1, f) != 1)
|
||||
die_errno("Could not write '%s'",
|
||||
filename);
|
||||
free(buf);
|
||||
}
|
||||
if (buf && fwrite(buf, 1, size, f) != size)
|
||||
die_errno("Could not write '%s'", filename);
|
||||
free(buf);
|
||||
} else
|
||||
fprintf(f, "%s\n", sha1_to_hex(obj->sha1));
|
||||
if (fclose(f))
|
||||
|
|
Loading…
Reference in a new issue