summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-09-09 23:24:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 01:23:11 (GMT)
commitae44b5a4f3b091bc77adc4a70e7bfefd569b78a8 (patch)
tree2d403db4d8bc989acdcded88ea4ca173eee0e1ba /diff-no-index.c
parent0c41a887b4729fe4899416ded42c40151afe00d0 (diff)
downloadgit-ae44b5a4f3b091bc77adc4a70e7bfefd569b78a8.zip
git-ae44b5a4f3b091bc77adc4a70e7bfefd569b78a8.tar.gz
git-ae44b5a4f3b091bc77adc4a70e7bfefd569b78a8.tar.bz2
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 'diff-no-index.c')
0 files changed, 0 insertions, 0 deletions