Skip to content

Commit be2e26a

Browse files
ramsay-jonesgitster
authored andcommitted
fixup! fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatal
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent df9481e commit be2e26a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

t/t5526-fetch-submodules.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ test_expect_success 'fetch --recurse-submodules fails when submodule commit is u
13121312
create_err_env env_default &&
13131313
push_unreachable_commit env_default &&
13141314
test_must_fail git -C env_default/clone fetch --recurse-submodules 2>err &&
1315-
grep "Errors during submodule fetch" err
1315+
test_grep "Errors during submodule fetch" err
13161316
'
13171317

13181318
test_expect_success 'fetch.submoduleErrors=warn: unreachable submodule commit is non-fatal' '
@@ -1321,7 +1321,7 @@ test_expect_success 'fetch.submoduleErrors=warn: unreachable submodule commit is
13211321
push_unreachable_commit env_warn_cfg &&
13221322
git -C env_warn_cfg/clone -c fetch.submoduleErrors=warn \
13231323
fetch --recurse-submodules 2>err &&
1324-
grep "Errors during submodule fetch" err
1324+
test_grep "Errors during submodule fetch" err
13251325
'
13261326

13271327
test_expect_success '--submodule-errors=warn: unreachable submodule commit is non-fatal' '
@@ -1330,7 +1330,7 @@ test_expect_success '--submodule-errors=warn: unreachable submodule commit is no
13301330
push_unreachable_commit env_warn_cli &&
13311331
git -C env_warn_cli/clone fetch --recurse-submodules \
13321332
--submodule-errors=warn 2>err &&
1333-
grep "Errors during submodule fetch" err
1333+
test_grep "Errors during submodule fetch" err
13341334
'
13351335

13361336
test_expect_success '--submodule-errors=fail: unreachable submodule commit is fatal' '
@@ -1339,7 +1339,7 @@ test_expect_success '--submodule-errors=fail: unreachable submodule commit is fa
13391339
push_unreachable_commit env_fail_cli &&
13401340
test_must_fail git -C env_fail_cli/clone fetch --recurse-submodules \
13411341
--submodule-errors=fail 2>err &&
1342-
grep "Errors during submodule fetch" err
1342+
test_grep "Errors during submodule fetch" err
13431343
'
13441344

13451345
test_expect_success 'fetch.submoduleErrors=warn does not suppress successful fetch' '
@@ -1355,7 +1355,7 @@ test_expect_success 'fetch.submoduleErrors=warn does not suppress successful fet
13551355
git -C env_ok/super_work push &&
13561356
git -C env_ok/clone -c fetch.submoduleErrors=warn \
13571357
fetch --recurse-submodules 2>err &&
1358-
! grep "Errors during submodule fetch" err
1358+
test_grep ! "Errors during submodule fetch" err
13591359
'
13601360

13611361
test_expect_success 'failed submodule fetch is fatal even when its commits are present locally' '
@@ -1382,7 +1382,7 @@ test_expect_success 'failed submodule fetch is fatal even when its commits are p
13821382
git -C env_phase1/super_work push &&
13831383
git -C env_phase1/clone/sub remote set-url origin "$pwd/env_phase1/missing" &&
13841384
test_must_fail git -C env_phase1/clone fetch --recurse-submodules 2>err &&
1385-
grep "Errors during submodule fetch" err
1385+
test_grep "Errors during submodule fetch" err
13861386
'
13871387

13881388
test_expect_success '--submodule-errors=warn is honored by fetch --all' '
@@ -1395,7 +1395,7 @@ test_expect_success '--submodule-errors=warn is honored by fetch --all' '
13951395
git -C env_all/clone remote add second "$pwd/env_all/super_bare" &&
13961396
git -C env_all/clone fetch --all --recurse-submodules \
13971397
--submodule-errors=warn 2>err &&
1398-
grep "Errors during submodule fetch" err
1398+
test_grep "Errors during submodule fetch" err
13991399
'
14001400

14011401
test_expect_success 'fetch.submoduleErrors=warn: inaccessible submodule is non-fatal' '
@@ -1405,9 +1405,9 @@ test_expect_success 'fetch.submoduleErrors=warn: inaccessible submodule is non-f
14051405
rm -r env_access/clone/.git/modules/sub &&
14061406
git -C env_access/clone -c fetch.submoduleErrors=warn \
14071407
fetch --recurse-submodules 2>err &&
1408-
grep "Could not access submodule" err &&
1408+
test_grep "Could not access submodule" err &&
14091409
test_must_fail git -C env_access/clone fetch --recurse-submodules 2>err &&
1410-
grep "Could not access submodule" err
1410+
test_grep "Could not access submodule" err
14111411
'
14121412

14131413
test_done

0 commit comments

Comments
 (0)