gpg-interface: drop pointless config_error_nonbool() checks
Config callbacks which use git_config_string() or git_config_pathname() have no need to check for a NULL value. This is handled automatically by those helpers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Dec 7, 2023 at 02:26 UTC
004c9432f7e4c9f1f3b915b0785d0f175dc664fe
1 file changed
+3
-12
gpg-interface.c
+3
-12
@@ -762,23 +762,14 @@ static int git_gpg_config(const char *var, const char *value,
762
return 0;
763
}
764
765
- if (!strcmp(var, "gpg.ssh.defaultkeycommand")) {
766
- if (!value)
767
- return config_error_nonbool(var);
765
+ if (!strcmp(var, "gpg.ssh.defaultkeycommand"))
766
return git_config_string(&ssh_default_key_command, var, value);
769
- }
767
771
- if (!strcmp(var, "gpg.ssh.allowedsignersfile")) {
772
- if (!value)
773
- return config_error_nonbool(var);
768
+ if (!strcmp(var, "gpg.ssh.allowedsignersfile"))
769
return git_config_pathname(&ssh_allowed_signers, var, value);
775
- }
770
777
- if (!strcmp(var, "gpg.ssh.revocationfile")) {
778
- if (!value)
779
- return config_error_nonbool(var);
771
+ if (!strcmp(var, "gpg.ssh.revocationfile"))
772
return git_config_pathname(&ssh_revocation_file, var, value);
781
- }
773
774
if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program"))
775
fmtname = "openpgp";