X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fsck.c;h=0cf5f012bdfa876fae4e15ed9cb94ed304314bf6;hb=1689c5de8730ea334535337a341db3c7a21ad002;hp=6883d1bd68d158290acb18ae9b4e8baba7525201;hpb=6b48990354b6380665565f21c3f89d2f7109c459;p=git.git diff --git a/fsck.c b/fsck.c index 6883d1bd6..0cf5f012b 100644 --- a/fsck.c +++ b/fsck.c @@ -155,8 +155,6 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func) o_mode = 0; o_name = NULL; o_sha1 = NULL; - if (!desc.size) - return error_func(&item->object, FSCK_ERROR, "empty tree"); while (desc.size) { unsigned mode; @@ -309,9 +307,8 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...) { va_list ap; int len; - struct strbuf sb; + struct strbuf sb = STRBUF_INIT; - strbuf_init(&sb, 0); strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)"); va_start(ap, fmt);