]> git.ipfire.org Git - thirdparty/git.git/commit
object-file-convert: convert commits that embed signed tags
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 2 Oct 2023 02:40:23 +0000 (21:40 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:57:39 +0000 (14:57 -0700)
commit08a45903cb32304946c11dfb2239db448777aed7
treea1074670654897270b0c5c96351c1b55ab66736c
parent318b023e4a3f5e4f2ecf202aa87db7e5df2c4442
object-file-convert: convert commits that embed signed tags

As mentioned in the hash function transition plan commit mergetag
lines need to be handled.  The commit mergetag lines embed an entire
tag object in a commit object.

Keep the implementation sane if not fast by unembedding the tag
object, converting the tag object, and embedding the new tag object,
in the new commit object.

In the long run I don't expect any other approach is maintainable, as
tag objects may be extended in ways that require additional
translation.

To keep the implementation of convert_commit_object maintainable I
have modified convert_commit_object to process the lines in any order,
and to fail on unknown lines.  We can't know ahead of time if a new
line might embed something that needs translation or not so it is
better to fail and require the code to be updated instead of silently
mistranslating objects.

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