]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
Merge branch 'mt/threaded-grep-in-object-store'
[thirdparty/git.git] / builtin / grep.c
index 629eaf5dbc9cc1c4e7d93c6d4e3ec7211f5d4df9..99e26850907b74374000675aa19bb42cf39c32b2 100644 (file)
@@ -946,6 +946,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                        /* die the same way as if we did it at the beginning */
                        setup_git_directory();
        }
+       /* Ignore --recurse-submodules if --no-index is given or implied */
+       if (!use_index)
+               recurse_submodules = 0;
 
        /*
         * skip a -- separator; we know it cannot be
@@ -1050,8 +1053,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
        pathspec.recursive = 1;
        pathspec.recurse_submodules = !!recurse_submodules;
 
-       if (recurse_submodules && (!use_index || untracked))
-               die(_("option not supported with --recurse-submodules"));
+       if (recurse_submodules && untracked)
+               die(_("--untracked not supported with --recurse-submodules"));
 
        if (show_in_pager) {
                if (num_threads > 1)