Skip to content

Commit 004c943

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37e8a34 commit 004c943

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

gpg-interface.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -762,23 +762,14 @@ static int git_gpg_config(const char *var, const char *value,
762762
return 0;
763763
}
764764

765-
if (!strcmp(var, "gpg.ssh.defaultkeycommand")) {
766-
if (!value)
767-
return config_error_nonbool(var);
765+
if (!strcmp(var, "gpg.ssh.defaultkeycommand"))
768766
return git_config_string(&ssh_default_key_command, var, value);
769-
}
770767

771-
if (!strcmp(var, "gpg.ssh.allowedsignersfile")) {
772-
if (!value)
773-
return config_error_nonbool(var);
768+
if (!strcmp(var, "gpg.ssh.allowedsignersfile"))
774769
return git_config_pathname(&ssh_allowed_signers, var, value);
775-
}
776770

777-
if (!strcmp(var, "gpg.ssh.revocationfile")) {
778-
if (!value)
779-
return config_error_nonbool(var);
771+
if (!strcmp(var, "gpg.ssh.revocationfile"))
780772
return git_config_pathname(&ssh_revocation_file, var, value);
781-
}
782773

783774
if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program"))
784775
fmtname = "openpgp";

0 commit comments

Comments
 (0)