summaryrefslogtreecommitdiff
path: root/list-objects.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-01-15 00:39:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-15 17:57:41 (GMT)
commit974e4a85e354d07fb4d50ff908713ecd5bcd4fff (patch)
tree17cecd126d72b19040c4218c6afa95f4db9b3b66 /list-objects.c
parentea82b2a0857e3e0449bdce4e3987dee6adbc51ae (diff)
downloadgit-974e4a85e354d07fb4d50ff908713ecd5bcd4fff.zip
git-974e4a85e354d07fb4d50ff908713ecd5bcd4fff.tar.gz
git-974e4a85e354d07fb4d50ff908713ecd5bcd4fff.tar.bz2
cache: make oidcpy always copy GIT_MAX_RAWSZ bytes
There are some situations in which we want to store an object ID into struct object_id without the_hash_algo necessarily being set correctly. One such case is when cloning a repository, where we must read refs from the remote side without having a repository from which to read the preferred algorithm. In this cases, we may have the_hash_algo set to SHA-1, which is the default, but read refs into struct object_id that are SHA-256. When copying these values, we will want to copy them completely, not just the first 20 bytes. Consequently, make sure that oidcpy copies the maximum number of bytes at all times, regardless of the setting of the_hash_algo. Since oidcpy and hashcpy are no longer functionally identical, remove the Cocinelle object_id transformations that convert from one into the other. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects.c')
0 files changed, 0 insertions, 0 deletions