tests: teach callers of test_i18ngrep to use test_grep
They are equivalents and the former still exists, so as long as the
only change this commit makes are to rewrite test_i18ngrep to
test_grep, there won't be any new bug, even if there still are
callers of test_i18ngrep remaining in the tree, or when merged to
other topics that add new uses of test_i18ngrep.
This patch was produced more or less with
git grep -l -e 'test_i18ngrep ' 't/t[0-9][0-9][0-9][0-9]-*.sh' |
xargs perl -p -i -e 's/test_i18ngrep /test_grep /'
and a good way to sanity check the result yourself is to run the
above in a checkout of c4603c1c (test framework: further deprecate
test_i18ngrep, 2023-10-31) and compare the resulting working tree
contents with the result of applying this patch to the same commit.
You'll see that test_i18ngrep in a few t/lib-*.sh files corrected,
in addition to the manual reproduction.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -60,7 +60,7 @@ test_expect_success 'submodule init aborts on missing .gitmodules file' '
|
||||
git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
|
||||
# missing the .gitmodules file here
|
||||
test_must_fail git submodule init 2>actual &&
|
||||
test_i18ngrep "No url found for submodule path" actual
|
||||
test_grep "No url found for submodule path" actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule update aborts on missing .gitmodules file' '
|
||||
@ -68,7 +68,7 @@ test_expect_success 'submodule update aborts on missing .gitmodules file' '
|
||||
git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
|
||||
# missing the .gitmodules file here
|
||||
git submodule update sub 2>actual &&
|
||||
test_i18ngrep "Submodule path .sub. not initialized" actual
|
||||
test_grep "Submodule path .sub. not initialized" actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule update aborts on missing gitmodules url' '
|
||||
@ -100,7 +100,7 @@ test_expect_success 'status should ignore inner git repo when not added' '
|
||||
) &&
|
||||
test_must_fail git submodule status inner 2>output.err &&
|
||||
rm -fr inner &&
|
||||
test_i18ngrep "^error: .*did not match any file(s) known to git" output.err
|
||||
test_grep "^error: .*did not match any file(s) known to git" output.err
|
||||
'
|
||||
|
||||
test_expect_success 'setup - repository in init subdirectory' '
|
||||
@ -196,7 +196,7 @@ test_expect_success 'redirected submodule add does not show progress' '
|
||||
git -C addtest submodule add "file://$submodurl/parent" submod-redirected \
|
||||
2>err &&
|
||||
! grep % err &&
|
||||
test_i18ngrep ! "Checking connectivity" err
|
||||
test_grep ! "Checking connectivity" err
|
||||
'
|
||||
|
||||
test_expect_success 'redirected submodule add --progress does show progress' '
|
||||
@ -263,7 +263,7 @@ test_expect_success 'submodule add relays add --dry-run stderr' '
|
||||
cd addtest &&
|
||||
: >.git/index.lock &&
|
||||
! git submodule add "$submodurl" sub-while-locked 2>output.err &&
|
||||
test_i18ngrep "^fatal: .*index\.lock" output.err &&
|
||||
test_grep "^fatal: .*index\.lock" output.err &&
|
||||
test_path_is_missing sub-while-locked
|
||||
)
|
||||
'
|
||||
@ -405,7 +405,7 @@ test_expect_success 'submodule add in subdirectory with relative path should fai
|
||||
cd addtest/sub &&
|
||||
test_must_fail git submodule add ../../ submod3 2>../../output.err
|
||||
) &&
|
||||
test_i18ngrep toplevel output.err
|
||||
test_grep toplevel output.err
|
||||
'
|
||||
|
||||
test_expect_success 'setup - add an example entry to .gitmodules' '
|
||||
@ -486,7 +486,7 @@ test_expect_success 'status should still be "missing" after initializing' '
|
||||
|
||||
test_failure_with_unknown_submodule () {
|
||||
test_must_fail git submodule $1 no-such-submodule 2>output.err &&
|
||||
test_i18ngrep "^error: .*no-such-submodule" output.err
|
||||
test_grep "^error: .*no-such-submodule" output.err
|
||||
}
|
||||
|
||||
test_expect_success 'init should fail with unknown submodule' '
|
||||
@ -644,7 +644,7 @@ test_expect_success 'update --init' '
|
||||
test_must_fail git config submodule.example.url &&
|
||||
|
||||
git submodule update init 2> update.out &&
|
||||
test_i18ngrep "not initialized" update.out &&
|
||||
test_grep "not initialized" update.out &&
|
||||
test_must_fail git rev-parse --resolve-git-dir init/.git &&
|
||||
|
||||
git submodule update --init init &&
|
||||
@ -661,7 +661,7 @@ test_expect_success 'update --init from subdirectory' '
|
||||
(
|
||||
cd sub &&
|
||||
git submodule update ../init 2>update.out &&
|
||||
test_i18ngrep "not initialized" update.out &&
|
||||
test_grep "not initialized" update.out &&
|
||||
test_must_fail git rev-parse --resolve-git-dir ../init/.git &&
|
||||
|
||||
git submodule update --init ../init
|
||||
@ -1121,7 +1121,7 @@ test_expect_success 'submodule deinit from subdirectory' '
|
||||
cd sub &&
|
||||
git submodule deinit ../init >../output
|
||||
) &&
|
||||
test_i18ngrep "\\.\\./init" output &&
|
||||
test_grep "\\.\\./init" output &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test -n "$(git config --get-regexp "submodule\.example2\.")" &&
|
||||
test -f example2/.git &&
|
||||
@ -1136,8 +1136,8 @@ test_expect_success 'submodule deinit . deinits all initialized submodules' '
|
||||
git submodule deinit . >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_i18ngrep "Cleared directory .example2" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .example2" actual &&
|
||||
rmdir init example2
|
||||
'
|
||||
|
||||
@ -1149,8 +1149,8 @@ test_expect_success 'submodule deinit --all deinits all initialized submodules'
|
||||
git submodule deinit --all >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_i18ngrep "Cleared directory .example2" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .example2" actual &&
|
||||
rmdir init example2
|
||||
'
|
||||
|
||||
@ -1160,8 +1160,8 @@ test_expect_success 'submodule deinit deinits a submodule when its work tree is
|
||||
git submodule deinit init example2 >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test -z "$(git config --get-regexp "submodule\.example2\.")" &&
|
||||
test_i18ngrep ! "Cleared directory .init" actual &&
|
||||
test_i18ngrep "Cleared directory .example2" actual &&
|
||||
test_grep ! "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .example2" actual &&
|
||||
rmdir init
|
||||
'
|
||||
|
||||
@ -1173,7 +1173,7 @@ test_expect_success 'submodule deinit fails when the submodule contains modifica
|
||||
test -f example2/.git &&
|
||||
git submodule deinit -f init >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
rmdir init
|
||||
'
|
||||
|
||||
@ -1185,7 +1185,7 @@ test_expect_success 'submodule deinit fails when the submodule contains untracke
|
||||
test -f example2/.git &&
|
||||
git submodule deinit -f init >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
rmdir init
|
||||
'
|
||||
|
||||
@ -1200,30 +1200,30 @@ test_expect_success 'submodule deinit fails when the submodule HEAD does not mat
|
||||
test -f example2/.git &&
|
||||
git submodule deinit -f init >actual &&
|
||||
test -z "$(git config --get-regexp "submodule\.example\.")" &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
rmdir init
|
||||
'
|
||||
|
||||
test_expect_success 'submodule deinit is silent when used on an uninitialized submodule' '
|
||||
git submodule update --init &&
|
||||
git submodule deinit init >actual &&
|
||||
test_i18ngrep "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
git submodule deinit init >actual &&
|
||||
test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
git submodule deinit . >actual &&
|
||||
test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_i18ngrep "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_grep "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
git submodule deinit . >actual &&
|
||||
test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_i18ngrep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_grep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
git submodule deinit --all >actual &&
|
||||
test_i18ngrep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_i18ngrep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_i18ngrep "Cleared directory .init" actual &&
|
||||
test_grep ! "Submodule .example. (.*) unregistered for path .init" actual &&
|
||||
test_grep ! "Submodule .example2. (.*) unregistered for path .example2" actual &&
|
||||
test_grep "Cleared directory .init" actual &&
|
||||
rmdir init example2
|
||||
'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user