submodule--helper: fix initialization of warn_if_uninitialized
commit4f1ccef87ca53a4d4e85f4df3cf2fbe8afb14e89
authorOrgad Shaneh <orgads@gmail.com>
Mon, 25 Apr 2022 12:45:41 +0000 (25 12:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Apr 2022 18:14:10 +0000 (26 11:14 -0700)
tree2ca3357e84d0d903b8a780c9b1f2bbfbea2fa8eb
parentf3875ab11528e605a0482940155e137537d238df
submodule--helper: fix initialization of warn_if_uninitialized

The .warn_if_uninitialized member was introduced by 48308681
(git submodule update: have a dedicated helper for cloning,
2016-02-29) to submodule_update_clone struct and initialized to
false.  When c9911c93 (submodule--helper: teach update_data more
options, 2022-03-15) moved it to update_data struct, it started
to initialize it to true but this change was not explained in
its log message.

The member is set to true only when pathspec was given, and is
used when a submodule that matched the pathspec is found
uninitialized to give diagnostic message.  "submodule update"
without pathspec is supposed to iterate over all submodules
(i.e. without pathspec limitation) and update only the
initialized submodules, and finding uninitialized submodules
during the iteration is a totally expected and normal thing that
should not be warned.

[jc: added tests]

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7406-submodule-update.sh