t3703, t4208: add test cases for magic pathspec
[gitweb.git] / builtin / grep.c
index 0bf8c0116a6a4c178a2c368f17d4103e91486624..222dd6d9afa98d02fc661926732620bc65d0881d 100644 (file)
@@ -956,13 +956,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                        verify_filename(prefix, argv[j]);
        }
 
-       if (i < argc)
-               paths = get_pathspec(prefix, argv + i);
-       else if (prefix) {
-               paths = xcalloc(2, sizeof(const char *));
-               paths[0] = prefix;
-               paths[1] = NULL;
-       }
+       paths = get_pathspec(prefix, argv + i);
        init_pathspec(&pathspec, paths);
        pathspec.max_depth = opt.max_depth;
        pathspec.recursive = 1;