Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jc/maint-fsck-fwrite-size-check'
author
Junio C Hamano
<gitster@pobox.com>
Wed, 5 Oct 2011 19:35:54 +0000
(12:35 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 5 Oct 2011 19:35:54 +0000
(12:35 -0700)
* jc/maint-fsck-fwrite-size-check:
fsck: do not abort upon finding an empty blob
builtin/fsck.c
patch
|
blob
|
history
raw
(from parent 1:
8f4c996
)
diff --git
a/builtin/fsck.c
b/builtin/fsck.c
index 5ae0366bc8cfe52f226c2af151a66d39b9df02aa..df1a88b51ae7773a15276d144113c0002fddb1cd 100644
(file)
--- a/
builtin/fsck.c
+++ b/
builtin/fsck.c
@@
-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))