summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2013-11-11 21:55:52 +0100
committerJunio C Hamano <gitster@pobox.com>2013-11-11 14:10:57 -0800
commit361412828ab580e145c3350cf075b283ebe331a5 (patch)
tree6e251b6233dce9beb305144b46efb1a193eb8380 /git-submodule.sh
parent0ecd94d7d728606e0047a44e60a277ff4e7b3990 (diff)
downloadgit-361412828ab580e145c3350cf075b283ebe331a5.tar.gz
submodule update: remove unnecessary orig_flags variablejl/submodule-update-retire-orig-flags
cmd_update() in the submodule script tries to preserve the options given on the command line in the "orig_flags" variable to pass them on into the recursion when the '--recursive' option is given. But this isn't necessary because all the variables set by the options will be seen in the recursion too as that is achieved by executing "eval cmd_update". The same has already been done for cmd_status() in e15bec0ec, so let's clean up cmd_update() likewise. Also add a test to make sure that a submodule name given on the command line is not passed into the recursion (which was the goal of adding the orig_flags variable in 98dbe63db). Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh5
1 files changed, 1 insertions, 4 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 896f1c9b82..74cbc53b53 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -706,7 +706,6 @@ cmd_deinit()
cmd_update()
{
# parse $args after "submodule ... update".
- orig_flags=
while test $# -ne 0
do
case "$1" in
@@ -731,7 +730,6 @@ cmd_update()
--reference)
case "$2" in '') usage ;; esac
reference="--reference=$2"
- orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
shift
;;
--reference=*)
@@ -765,7 +763,6 @@ cmd_update()
break
;;
esac
- orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
shift
done
@@ -909,7 +906,7 @@ Maybe you want to use 'update --init'?")"
prefix="$prefix$sm_path/"
clear_local_git_env
cd "$sm_path" &&
- eval cmd_update "$orig_flags"
+ eval cmd_update
)
res=$?
if test $res -gt 0