Skip to content

Commit

Permalink
Merge branch 'jl/submodule-update-retire-orig-flags'
Browse files Browse the repository at this point in the history
Code clean-up.

* jl/submodule-update-retire-orig-flags:
  submodule update: remove unnecessary orig_flags variable
  • Loading branch information
Junio C Hamano committed Dec 5, 2013
2 parents c3dc382 + 3614128 commit c83386d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 1 addition & 4 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ cmd_deinit()
cmd_update()
{
# parse $args after "submodule ... update".
orig_flags=
while test $# -ne 0
do
case "$1" in
Expand All @@ -746,7 +745,6 @@ cmd_update()
--reference)
case "$2" in '') usage ;; esac
reference="--reference=$2"
orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
shift
;;
--reference=*)
Expand Down Expand Up @@ -780,7 +778,6 @@ cmd_update()
break
;;
esac
orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
shift
done

Expand Down Expand Up @@ -924,7 +921,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
Expand Down
11 changes: 11 additions & 0 deletions t/t7406-submodule-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,17 @@ test_expect_success 'submodule update clone shallow submodule' '
(cd submodule &&
test 1 = $(git log --oneline | wc -l)
)
)
'

test_expect_success 'submodule update --recursive drops module name before recursing' '
(cd super2 &&
(cd deeper/submodule/subsubmodule &&
git checkout HEAD^
) &&
git submodule update --recursive deeper/submodule >actual &&
test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
)
'

test_done

0 comments on commit c83386d

Please sign in to comment.