| 736 | } |
| 737 | |
| 738 | static int git_gpg_config(const char *var, const char *value, |
| 739 | const struct config_context *ctx UNUSED, |
| 740 | void *cb UNUSED) |
| 741 | { |
| 742 | struct gpg_format *fmt = NULL; |
| 743 | const char *fmtname = NULL; |
| 744 | char *trust; |
| 745 | int ret; |
| 746 | |
| 747 | if (!strcmp(var, "user.signingkey")) { |
| 748 | if (!value) |
| 749 | return config_error_nonbool(var); |
| 750 | set_signing_key(value); |
| 751 | return 0; |
| 752 | } |
| 753 | |
| 754 | if (!strcmp(var, "gpg.format")) { |
| 755 | if (!value) |
| 756 | return config_error_nonbool(var); |
| 757 | fmt = get_format_by_name(value); |
| 758 | if (!fmt) |
| 759 | return error(_("invalid value for '%s': '%s'"), |
| 760 | var, value); |
| 761 | use_format = fmt; |
| 762 | return 0; |
| 763 | } |
| 764 | |
| 765 | if (!strcmp(var, "gpg.mintrustlevel")) { |
| 766 | if (!value) |
| 767 | return config_error_nonbool(var); |
| 768 | |
| 769 | trust = xstrdup_toupper(value); |
| 770 | ret = parse_gpg_trust_level(trust, &configured_min_trust_level); |
| 771 | free(trust); |
| 772 | |
| 773 | if (ret) |
| 774 | return error(_("invalid value for '%s': '%s'"), |
| 775 | var, value); |
| 776 | return 0; |
| 777 | } |
| 778 | |
| 779 | if (!strcmp(var, "gpg.ssh.defaultkeycommand")) |
| 780 | return git_config_string(&ssh_default_key_command, var, value); |
| 781 | |
| 782 | if (!strcmp(var, "gpg.ssh.allowedsignersfile")) |
| 783 | return git_config_pathname(&ssh_allowed_signers, var, value); |
| 784 | |
| 785 | if (!strcmp(var, "gpg.ssh.revocationfile")) |
| 786 | return git_config_pathname(&ssh_revocation_file, var, value); |
| 787 | |
| 788 | if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program")) |
| 789 | fmtname = "openpgp"; |
| 790 | |
| 791 | if (!strcmp(var, "gpg.x509.program")) |
| 792 | fmtname = "x509"; |
| 793 | |
| 794 | if (!strcmp(var, "gpg.ssh.program")) |
| 795 | fmtname = "ssh"; |
nothing calls this directly
no test coverage detected