diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-09-09 19:24:32 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-09 18:23:11 -0700 |
commit | ae44b5a4f3b091bc77adc4a70e7bfefd569b78a8 (patch) | |
tree | 2d403db4d8bc989acdcded88ea4ca173eee0e1ba /builtin | |
parent | pack.h: line-wrap the definition of finish_tmp_packfile() (diff) | |
download | tgif-ae44b5a4f3b091bc77adc4a70e7bfefd569b78a8.tar.xz |
bulk-checkin.c: store checksum directly
finish_bulk_checkin() stores the checksum from finalize_hashfile() by
writing to the `hash` member of `struct object_id`, but that hash has
nothing to do with an object id (it's just a convenient location that
happens to be sized correctly).
Store the hash directly in an unsigned char array. This behaves the same
as writing to the `hash` member, but makes the intent clearer (and
avoids allocating an extra four bytes for the `algo` member of `struct
object_id`). It likewise prevents the possibility of a segfault when
reading `algo` (e.g., by calling `oid_to_hex()`) if it is uninitialized.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions