From: Stefan Beller Date: Fri, 29 Jul 2016 00:44:05 GMT Subject: [PATCHv3 3/7] submodule update: narrow scope of local variable Message-ID: <20160729004409.2072-4-sbeller@google.com> In-Reply-To: <20160729004409.2072-1-sbeller@google.com> Signed-off-by: Stefan Beller --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 174f4ea..0d4021f 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -591,7 +591,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 @@ -617,6 +616,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 -- 2.9.2.472.g1ffb07c.dirty