diff options
author | 2020-02-12 12:41:36 -0800 | |
---|---|---|
committer | 2020-02-12 12:41:36 -0800 | |
commit | 556ccd4dd2943009270b46b9af443a396bff4dfc (patch) | |
tree | 9dae6954b6e8d3bfa1eb3050997248d10646fae0 /t | |
parent | Merge branch 'hw/doc-git-dir' (diff) | |
parent | grep: ignore --recurse-submodules if --no-index is given (diff) | |
download | tgif-556ccd4dd2943009270b46b9af443a396bff4dfc.tar.xz |
Merge branch 'pb/do-not-recurse-grep-no-index'
"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 't')
-rwxr-xr-x | t/t7814-grep-recurse-submodules.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/t7814-grep-recurse-submodules.sh b/t/t7814-grep-recurse-submodules.sh index 946f91fa57..828cb3ba58 100755 --- a/t/t7814-grep-recurse-submodules.sh +++ b/t/t7814-grep-recurse-submodules.sh @@ -345,7 +345,16 @@ test_incompatible_with_recurse_submodules () } test_incompatible_with_recurse_submodules --untracked -test_incompatible_with_recurse_submodules --no-index + +test_expect_success 'grep --recurse-submodules --no-index ignores --recurse-submodules' ' + git grep --recurse-submodules --no-index -e "^(.|.)[\d]" >actual && + cat >expect <<-\EOF && + a:(1|2)d(3|4) + submodule/a:(1|2)d(3|4) + submodule/sub/a:(1|2)d(3|4) + EOF + test_cmp expect actual +' test_expect_success 'grep --recurse-submodules should pass the pattern type along' ' # Fixed |