Skip to content

Commit

Permalink
Merge branch 'jc/gpg-status'
Browse files Browse the repository at this point in the history
"git verify-tag" and "git verify-commit" have been taught to use
the exit status of underlying "gpg --verify" to signal bad or
untrusted signature they found.

* jc/gpg-status:
  gpg-interface: propagate exit status from gpg back to the callers
  • Loading branch information
gitster committed Aug 20, 2018
2 parents 6e8f3d1 + 4e5dc9c commit 4d34122
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gpg-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ int check_signature(const char *payload, size_t plen, const char *signature,
sigc->gpg_output = strbuf_detach(&gpg_output, NULL);
sigc->gpg_status = strbuf_detach(&gpg_status, NULL);
parse_gpg_output(sigc);
status |= sigc->result != 'G' && sigc->result != 'U';

out:
strbuf_release(&gpg_status);
strbuf_release(&gpg_output);

return sigc->result != 'G' && sigc->result != 'U';
return !!status;
}

void print_signature_buffer(const struct signature_check *sigc, unsigned flags)
Expand Down

0 comments on commit 4d34122

Please sign in to comment.