diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-04-28 17:46:04 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-28 17:46:04 (GMT) |
commit | 740deeadd3d2c10b8a98573fdf65aa433a0bf816 (patch) | |
tree | 861085b2f2c29179a3d8247502af31e05b1390f7 /t | |
parent | 6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e (diff) | |
parent | 4f1ccef87ca53a4d4e85f4df3cf2fbe8afb14e89 (diff) | |
download | git-740deeadd3d2c10b8a98573fdf65aa433a0bf816.zip git-740deeadd3d2c10b8a98573fdf65aa433a0bf816.tar.gz git-740deeadd3d2c10b8a98573fdf65aa433a0bf816.tar.bz2 |
Merge branch 'gc/submodule-update-part2'
"git submodule update" without pathspec should silently skip an
uninitialized submodule, but it started to become noisy by mistake.
* gc/submodule-update-part2:
submodule--helper: fix initialization of warn_if_uninitialized
Diffstat (limited to 't')
-rwxr-xr-x | t/t7406-submodule-update.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index 000e055..43f779d 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -670,6 +670,39 @@ test_expect_success 'submodule update --init skips submodule with update=none' ' ) ' +test_expect_success 'submodule update with pathspec warns against uninitialized ones' ' + test_when_finished "rm -fr selective" && + git clone super selective && + ( + cd selective && + git submodule init submodule && + + git submodule update submodule 2>err && + ! grep "Submodule path .* not initialized" err && + + git submodule update rebasing 2>err && + grep "Submodule path .rebasing. not initialized" err && + + test_path_exists submodule/.git && + test_path_is_missing rebasing/.git + ) + +' + +test_expect_success 'submodule update without pathspec updates only initialized ones' ' + test_when_finished "rm -fr selective" && + git clone super selective && + ( + cd selective && + git submodule init submodule && + git submodule update 2>err && + test_path_exists submodule/.git && + test_path_is_missing rebasing/.git && + ! grep "Submodule path .* not initialized" err + ) + +' + test_expect_success 'submodule update continues after checkout error' ' (cd super && git reset --hard HEAD && |