summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:31 (GMT)
commit153a1b46f1a4ef46cf257ed14741cb7d3e8c9ada (patch)
tree47873571baa2b6d320b0847ed2a494e2ba8a1e06 /builtin
parent8857657cc93128753bfe3708c170de63c0fcb273 (diff)
parentc56c48dd0750dc7759f5e9a33cd4a01d6162b06e (diff)
downloadgit-153a1b46f1a4ef46cf257ed14741cb7d3e8c9ada.zip
git-153a1b46f1a4ef46cf257ed14741cb7d3e8c9ada.tar.gz
git-153a1b46f1a4ef46cf257ed14741cb7d3e8c9ada.tar.bz2
Merge branch 'pb/do-not-recurse-grep-no-index' into maint
"git grep --no-index" should not get affected by the contents of the .gitmodules file but when "--recurse-submodules" is given or the "submodule.recurse" variable is set, it did. Now these settings are ignored in the "--no-index" mode. * pb/do-not-recurse-grep-no-index: grep: ignore --recurse-submodules if --no-index is given
Diffstat (limited to 'builtin')
-rw-r--r--builtin/grep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 50ce8d9..ae2d5bb 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -958,6 +958,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
@@ -1115,8 +1118,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}
}
- 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 && !opt.status_only)
setup_pager();