From: Stefan Beller Date: Fri, 29 Jul 2016 00:44:05 +0000 (-0700) Subject: submodule update: narrow scope of local variable X-Git-Tag: v2.10.2~10^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/341238ebc4c95a351db2e047a0ca2340766b48e8 submodule update: narrow scope of local variable Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 40639ee231..41aff65fac 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -589,7 +589,6 @@ cmd_update() name=$(git submodule--helper name "$sm_path") || exit url=$(git config submodule."$name".url) - branch=$(get_submodule_config "$name" branch master) if ! test -z "$update" then update_module=$update @@ -615,6 +614,7 @@ cmd_update() if test -n "$remote" then + branch=$(get_submodule_config "$name" branch master) if test -z "$nofetch" then # Fetch remote before determining tracking $sha1