]> git.ipfire.org Git - thirdparty/git.git/commitdiff
replay: do not copy "gpgsign-sha256" header
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 26 Nov 2025 14:33:37 +0000 (14:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Nov 2025 17:33:52 +0000 (09:33 -0800)
When "git replay" replays a commit it copies the extended headers
across from the original commit. However, if the original commit
was signed, we do not want to copy the header associated with the
signature is it wont be valid for the new commit. The code already
knows to avoid coping the "gpgsig" header but does not know to avoid
copying the "gpgsig-sha256" header.  Add that header to the list of
exclusions to match what "git commit --amend" does.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/replay.c

index 6172c8aacc9873f417446ad88f7b04901264ef98..d12e4d548727d6b9be8482a62c82c012a2127518 100644 (file)
@@ -67,7 +67,7 @@ static struct commit *create_commit(struct repository *repo,
        const char *message = repo_logmsg_reencode(repo, based_on,
                                                   NULL, out_enc);
        const char *orig_message = NULL;
-       const char *exclude_gpgsig[] = { "gpgsig", NULL };
+       const char *exclude_gpgsig[] = { "gpgsig", "gpgsig-sha256", NULL };
 
        commit_list_insert(parent, &parents);
        extra = read_commit_extra_headers(based_on, exclude_gpgsig);