Skip to content

Commit 300cd14

Browse files
committed
Merge branch 'td/submodule-update-quiet'
"git submodule update --quiet" did not squelch underlying "rebase" and "pull" commands. * td/submodule-update-quiet: submodule update: silence underlying merge/rebase with "--quiet"
2 parents 19dd352 + 3ad0401 commit 300cd14

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

git-submodule.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ cmd_update()
440440
GIT_QUIET=1
441441
;;
442442
-v)
443-
GIT_QUIET=0
443+
unset GIT_QUIET
444444
;;
445445
--progress)
446446
progress=1
@@ -614,13 +614,13 @@ cmd_update()
614614
say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")"
615615
;;
616616
rebase)
617-
command="git rebase"
617+
command="git rebase ${GIT_QUIET:+--quiet}"
618618
die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$displaypath'")"
619619
say_msg="$(eval_gettext "Submodule path '\$displaypath': rebased into '\$sha1'")"
620620
must_die_on_failure=yes
621621
;;
622622
merge)
623-
command="git merge"
623+
command="git merge ${GIT_QUIET:+--quiet}"
624624
die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$displaypath'")"
625625
say_msg="$(eval_gettext "Submodule path '\$displaypath': merged in '\$sha1'")"
626626
must_die_on_failure=yes

t/t7406-submodule-update.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,4 +1022,16 @@ test_expect_success 'git clone passes the parallel jobs config on to submodules'
10221022
rm -rf super4
10231023
'
10241024

1025+
test_expect_success 'submodule update --quiet passes quietness to merge/rebase' '
1026+
(cd super &&
1027+
test_commit -C rebasing message &&
1028+
git submodule update --rebase --quiet >out 2>err &&
1029+
test_must_be_empty out &&
1030+
test_must_be_empty err &&
1031+
git submodule update --rebase -v >out 2>err &&
1032+
test_file_not_empty out &&
1033+
test_must_be_empty err
1034+
)
1035+
'
1036+
10251037
test_done

0 commit comments

Comments
 (0)