Skip to content

Commit 817bac3

Browse files
hvoigtgitster
authored andcommitted
submodule: move update configuration variable further up
Lets always initialize the 'update_module' variable with the final value. This way we allow code which wants to check this configuration early to do so right in the beginning of cmd_update(). Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1421fd9 commit 817bac3

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

git-submodule.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,13 @@ cmd_update()
461461
fi
462462
name=$(module_name "$path") || exit
463463
url=$(git config submodule."$name".url)
464-
update_module=$(git config submodule."$name".update)
464+
if ! test -z "$update"
465+
then
466+
update_module=$update
467+
else
468+
update_module=$(git config submodule."$name".update)
469+
fi
470+
465471
if test -z "$url"
466472
then
467473
# Only mention uninitialized submodules when its
@@ -483,11 +489,6 @@ Maybe you want to use 'update --init'?")"
483489
die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
484490
fi
485491

486-
if ! test -z "$update"
487-
then
488-
update_module=$update
489-
fi
490-
491492
if test "$subsha1" != "$sha1"
492493
then
493494
subforce=$force

0 commit comments

Comments
 (0)