Code

git-check-attr: Error out if no pathnames are specified
[git.git] / builtin / check-attr.c
index e9b827ffb58f10d3cdcb73e45e332e34ae2b47ed..6cf6421399644b359e08ea84493de419c71bc941 100644 (file)
@@ -111,8 +111,13 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
        }
 
        /* Check file argument(s): */
-       if (stdin_paths && filei < argc)
-               error_with_usage("Can't specify files with --stdin");
+       if (stdin_paths) {
+               if (filei < argc)
+                       error_with_usage("Can't specify files with --stdin");
+       } else {
+               if (filei >= argc)
+                       error_with_usage("No file specified");
+       }
 
        check = xcalloc(cnt, sizeof(*check));
        for (i = 0; i < cnt; i++) {