]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gpg-interface: drop pointless config_error_nonbool() checks
authorJeff King <peff@peff.net>
Thu, 7 Dec 2023 07:26:31 +0000 (02:26 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Dec 2023 23:26:22 +0000 (08:26 +0900)
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>
gpg-interface.c

index 48f43c5a21d34569bdc966eefd652da38003d157..25c42cb9fde8a5b58e69c7de811606efb7f5ebe0 100644 (file)
@@ -762,23 +762,14 @@ static int git_gpg_config(const char *var, const char *value,
                return 0;
        }
 
-       if (!strcmp(var, "gpg.ssh.defaultkeycommand")) {
-               if (!value)
-                       return config_error_nonbool(var);
+       if (!strcmp(var, "gpg.ssh.defaultkeycommand"))
                return git_config_string(&ssh_default_key_command, var, value);
-       }
 
-       if (!strcmp(var, "gpg.ssh.allowedsignersfile")) {
-               if (!value)
-                       return config_error_nonbool(var);
+       if (!strcmp(var, "gpg.ssh.allowedsignersfile"))
                return git_config_pathname(&ssh_allowed_signers, var, value);
-       }
 
-       if (!strcmp(var, "gpg.ssh.revocationfile")) {
-               if (!value)
-                       return config_error_nonbool(var);
+       if (!strcmp(var, "gpg.ssh.revocationfile"))
                return git_config_pathname(&ssh_revocation_file, var, value);
-       }
 
        if (!strcmp(var, "gpg.program") || !strcmp(var, "gpg.openpgp.program"))
                fmtname = "openpgp";