commit: use expected signature header for SHA-256
commit42d4e1d1128fa1cb56032ac58f65ea3dd1296a9a
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 22 Feb 2020 20:17:42 +0000 (22 20:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2020 17:33:30 +0000 (24 09:33 -0800)
treefe7a1954c437e62ebe0a5bb7f0f82ff8fb70c114
parente02a7141f83326f7098800fed764061ecf1f0eff
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
commit.c
sequencer.c
t/t1450-fsck.sh
t/t7510-signed-commit.sh