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>

Heiko Voigt committed Aug 11, 2011 at 19:51 UTC 817bac35f24166e8b306ecef5283ed721068f113
1 file changed +7 -6
git-submodule.sh
+7 -6
@@ -461,7 +461,13 @@ cmd_update()
461 fi
462 name=$(module_name "$path") || exit
463 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 +
471 if test -z "$url"
472 then
473 # Only mention uninitialized submodules when its
@@ -483,11 +489,6 @@ Maybe you want to use 'update --init'?")"
489 die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
490 fi
491
486 - if ! test -z "$update"
487 - then
488 - update_module=$update
489 - fi
490 -
492 if test "$subsha1" != "$sha1"
493 then
494 subforce=$force