Code

pre-commit.sample: don't print incidental SHA1
[git.git] / builtin-verify-tag.c
index db81496b464e253341a42e01eb72d6845e87199c..729a1593e61d87ad4596f07e7faedac81de64e81 100644 (file)
@@ -12,7 +12,7 @@
 #include <signal.h>
 
 static const char builtin_verify_tag_usage[] =
-               "git-verify-tag [-v|--verbose] <tag>...";
+               "git verify-tag [-v|--verbose] <tag>...";
 
 #define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
 
@@ -90,16 +90,17 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 {
        int i = 1, verbose = 0, had_error = 0;
 
-       git_config(git_default_config);
+       git_config(git_default_config, NULL);
 
-       if (argc == 1)
-               usage(builtin_verify_tag_usage);
-
-       if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")) {
+       if (argc > 1 &&
+           (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose"))) {
                verbose = 1;
                i++;
        }
 
+       if (argc <= i)
+               usage(builtin_verify_tag_usage);
+
        /* sometimes the program was terminated because this signal
         * was received in the process of writing the gpg input: */
        signal(SIGPIPE, SIG_IGN);