From 42d4e1d1128fa1cb56032ac58f65ea3dd1296a9a Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sat, 22 Feb 2020 20:17:42 +0000 Subject: commit: use expected signature header for SHA-256 The transition plan anticipates that we will allow signatures using multiple algorithms in a single commit. In order to do so, we need to use a different header per algorithm so that it will be obvious over which data to compute the signature. The transition plan specifies that we should use "gpgsig-sha256", so wire up the commit code such that it can write and parse the current algorithm, and it can remove the headers for any algorithm when creating a new commit. Add tests to ensure that we write using the right header and that git fsck doesn't reject these commits. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/commit.c') diff --git a/builtin/commit.c b/builtin/commit.c index 7ba33a3bec..798d362a2e 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1659,7 +1659,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) } if (amend) { - const char *exclude_gpgsig[2] = { "gpgsig", NULL }; + const char *exclude_gpgsig[3] = { "gpgsig", "gpgsig-sha256", NULL }; extra = read_commit_extra_headers(current_head, exclude_gpgsig); } else { struct commit_extra_header **tail = &extra; -- cgit 1.2.3-korg