merge: extract verify_merge_signature() helper
The logic to implement "merge --verify-signatures" is inline in cmd_merge(), but this site misses some cases. Let's extract the logic into a function so we can call it from more places. We'll move it to commit.[ch], since one of the callers (git-pull) is outside our source file. This function isn't all that general (after all, its main function is to exit the program) but it's not worth trying to fix that. The heavy lifting is done by check_commit_signature(), and our purpose here is just sharing the die() logic. We'll mark it with a comment to make that clear. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
cae598d998
commit
edc4d47d54
7
commit.h
7
commit.h
@ -357,6 +357,13 @@ extern int remove_signature(struct strbuf *buf);
|
||||
*/
|
||||
extern int check_commit_signature(const struct commit *commit, struct signature_check *sigc);
|
||||
|
||||
/*
|
||||
* Verify a single commit with check_commit_signature() and die() if it is not
|
||||
* a good signature. This isn't really suitable for general use, but is a
|
||||
* helper to implement consistent logic for pull/merge --verify-signatures.
|
||||
*/
|
||||
void verify_merge_signature(struct commit *commit, int verbose);
|
||||
|
||||
int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused);
|
||||
int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void *unused);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user