Skip to content

Commit c83386d

Browse files
committed
Merge branch 'jl/submodule-update-retire-orig-flags'
Code clean-up. * jl/submodule-update-retire-orig-flags: submodule update: remove unnecessary orig_flags variable
2 parents c3dc382 + 3614128 commit c83386d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

git-submodule.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,6 @@ cmd_deinit()
721721
cmd_update()
722722
{
723723
# parse $args after "submodule ... update".
724-
orig_flags=
725724
while test $# -ne 0
726725
do
727726
case "$1" in
@@ -746,7 +745,6 @@ cmd_update()
746745
--reference)
747746
case "$2" in '') usage ;; esac
748747
reference="--reference=$2"
749-
orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
750748
shift
751749
;;
752750
--reference=*)
@@ -780,7 +778,6 @@ cmd_update()
780778
break
781779
;;
782780
esac
783-
orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
784781
shift
785782
done
786783

@@ -924,7 +921,7 @@ Maybe you want to use 'update --init'?")"
924921
prefix="$prefix$sm_path/"
925922
clear_local_git_env
926923
cd "$sm_path" &&
927-
eval cmd_update "$orig_flags"
924+
eval cmd_update
928925
)
929926
res=$?
930927
if test $res -gt 0

t/t7406-submodule-update.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,17 @@ test_expect_success 'submodule update clone shallow submodule' '
762762
(cd submodule &&
763763
test 1 = $(git log --oneline | wc -l)
764764
)
765+
)
766+
'
767+
768+
test_expect_success 'submodule update --recursive drops module name before recursing' '
769+
(cd super2 &&
770+
(cd deeper/submodule/subsubmodule &&
771+
git checkout HEAD^
772+
) &&
773+
git submodule update --recursive deeper/submodule >actual &&
774+
test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
765775
)
766776
'
777+
767778
test_done

0 commit comments

Comments
 (0)