summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-05 18:54:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-05 21:02:26 (GMT)
commitc871a1d17b8433d98df59b03da5538f10c4ae52c (patch)
treece9d496f4015b0aa1ac08eca1f3c2e7357c725cb /builtin
parente3f55e07076f88ec01a49dcfb7c2ac56658145a4 (diff)
downloadgit-c871a1d17b8433d98df59b03da5538f10c4ae52c.zip
git-c871a1d17b8433d98df59b03da5538f10c4ae52c.tar.gz
git-c871a1d17b8433d98df59b03da5538f10c4ae52c.tar.bz2
commit --amend -S: strip existing gpgsig headers
Any existing commit signature was made against the contents of the old commit, including its committer date that is about to change, and will become invalid by amending it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index fa41ec8..970a836 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1494,7 +1494,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
}
if (amend) {
- extra = read_commit_extra_headers(current_head);
+ const char *exclude_gpgsig[2] = { "gpgsig", NULL };
+ extra = read_commit_extra_headers(current_head, exclude_gpgsig);
} else {
struct commit_extra_header **tail = &extra;
append_merge_tag_headers(parents, &tail);