Merge branch 'jl/submodule-update-retire-orig-flags'
Code clean-up. * jl/submodule-update-retire-orig-flags: submodule update: remove unnecessary orig_flags variable
This commit is contained in:
commit
c83386d14d
@ -721,7 +721,6 @@ cmd_deinit()
|
||||
cmd_update()
|
||||
{
|
||||
# parse $args after "submodule ... update".
|
||||
orig_flags=
|
||||
while test $# -ne 0
|
||||
do
|
||||
case "$1" in
|
||||
@ -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=*)
|
||||
@ -780,7 +778,6 @@ cmd_update()
|
||||
break
|
||||
;;
|
||||
esac
|
||||
orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
|
||||
shift
|
||||
done
|
||||
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user