Jeff King 7ac4f3a007 fsck: actually fsck blob data
Because fscking a blob has always been a noop, we didn't
bother passing around the blob data. In preparation for
content-level checks, let's fix up a few things:

  1. The fsck_object() function just returns success for any
     blob. Let's a noop fsck_blob(), which we can fill in
     with actual logic later.

  2. The fsck_loose() function in builtin/fsck.c
     just threw away blob content after loading it. Let's
     hold onto it until after we've called fsck_object().

     The easiest way to do this is to just drop the
     parse_loose_object() helper entirely. Incidentally,
     this also fixes a memory leak: if we successfully
     loaded the object data but did not parse it, we would
     have left the function without freeing it.

  3. When fsck_loose() loads the object data, it
     does so with a custom read_loose_object() helper. This
     function streams any blobs, regardless of size, under
     the assumption that we're only checking the sha1.

     Instead, let's actually load blobs smaller than
     big_file_threshold, as the normal object-reading
     code-paths would do. This lets us fsck small files, and
     a NULL return is an indication that the blob was so big
     that it needed to be streamed, and we can pass that
     information along to fsck_blob().

Signed-off-by: Jeff King <peff@peff.net>
2018-05-21 23:55:12 -04:00
..
2017-10-06 10:07:18 +09:00
2018-02-07 12:41:36 -08:00
2018-03-06 14:54:07 -08:00
2018-02-27 10:33:57 -08:00
2017-10-07 16:27:55 +09:00
2018-03-14 12:01:07 -07:00
2018-05-21 23:55:12 -04:00
2018-03-14 12:01:07 -07:00
2018-03-14 12:01:07 -07:00
2018-02-22 10:08:05 -08:00
2018-02-22 10:08:05 -08:00
2017-11-21 14:07:50 +09:00
2017-06-24 14:28:41 -07:00
2018-03-06 14:54:07 -08:00
2018-03-14 12:01:07 -07:00
2017-08-26 22:55:09 -07:00
2018-03-06 14:54:07 -08:00
2018-03-14 12:01:07 -07:00
2018-03-14 12:01:07 -07:00
2017-12-08 09:52:42 -08:00
2018-03-06 14:54:07 -08:00
2017-12-13 11:15:14 -08:00
2017-08-22 10:29:03 -07:00
2017-12-27 11:16:29 -08:00
2018-03-14 12:01:07 -07:00