]> git.ipfire.org Git - thirdparty/git.git/commit
object-file-convert: convert commit objects when writing
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 2 Oct 2023 02:40:22 +0000 (21:40 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:57:39 +0000 (14:57 -0700)
commit318b023e4a3f5e4f2ecf202aa87db7e5df2c4442
tree351312b29869091f52960813292671c8655b8084
parentac45d995f3329e5a7e85bf103bd94b48107b3803
object-file-convert: convert commit objects when writing

When writing a commit object in a repository with both SHA-1 and
SHA-256, we'll need to convert our commit objects so that we can write
the hash values for both into the repository.  To do so, let's add a
function to convert commit objects.

Read the commit object and map the tree value and any of the parent
values, and copy the rest of the commit through unmodified.  Note that
we don't need to modify the signature headers, because they are the
same under both algorithms.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file-convert.c