mirror of
https://github.com/git/git.git
synced 2024-10-19 23:28:32 +02:00
Merge branch 'gc/submodule-update-part2' into maint
"git submodule update" without pathspec should silently skip an uninitialized submodule, but it started to become noisy by mistake. This fixes a regression in 2.36 and is slate to go to 2.36.1 source: <pull.1258.v2.git.git.1650890741430.gitgitgadget@gmail.com> * gc/submodule-update-part2: submodule--helper: fix initialization of warn_if_uninitialized
This commit is contained in:
commit
899df5f690
@ -2026,7 +2026,6 @@ struct update_data {
|
||||
.references = STRING_LIST_INIT_DUP, \
|
||||
.single_branch = -1, \
|
||||
.max_jobs = 1, \
|
||||
.warn_if_uninitialized = 1, \
|
||||
}
|
||||
|
||||
static void next_submodule_warn_missing(struct submodule_update_clone *suc,
|
||||
|
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user