diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-01 11:16:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-01 15:06:00 -0700 |
commit | 01cab9767929c6c3faf4f4ad3b348639655f04fd (patch) | |
tree | c32db47dd9f871cd3e38f4de8f349063945238af /t/t5610-clone-detached.sh | |
parent | object-file.c: make parse_loose_header_extended() public (diff) | |
download | tgif-01cab9767929c6c3faf4f4ad3b348639655f04fd.tar.xz |
object-file.c: simplify unpack_loose_short_header()
Combine the unpack_loose_short_header(),
unpack_loose_header_to_strbuf() and unpack_loose_header() functions
into one.
The unpack_loose_header_to_strbuf() function was added in
46f034483eb (sha1_file: support reading from a loose object of unknown
type, 2015-05-03).
Its code was mostly copy/pasted between it and both of
unpack_loose_header() and unpack_loose_short_header(). We now have a
single unpack_loose_header() function which accepts an optional
"struct strbuf *" instead.
I think the remaining unpack_loose_header() function could be further
simplified, we're carrying some complexity just to be able to emit a
garbage type longer than MAX_HEADER_LEN, we could alternatively just
say "we found a garbage type <first 32 bytes>..." instead. But let's
leave the current behavior in place for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5610-clone-detached.sh')
0 files changed, 0 insertions, 0 deletions