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"
This commit is contained in:
Junio C Hamano
2020-10-05 14:01:53 -07:00
2 changed files with 15 additions and 3 deletions

View File

@ -440,7 +440,7 @@ cmd_update()
GIT_QUIET=1 GIT_QUIET=1
;; ;;
-v) -v)
GIT_QUIET=0 unset GIT_QUIET
;; ;;
--progress) --progress)
progress=1 progress=1
@ -614,13 +614,13 @@ cmd_update()
say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")" say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")"
;; ;;
rebase) rebase)
command="git rebase" command="git rebase ${GIT_QUIET:+--quiet}"
die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$displaypath'")" die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$displaypath'")"
say_msg="$(eval_gettext "Submodule path '\$displaypath': rebased into '\$sha1'")" say_msg="$(eval_gettext "Submodule path '\$displaypath': rebased into '\$sha1'")"
must_die_on_failure=yes must_die_on_failure=yes
;; ;;
merge) merge)
command="git merge" command="git merge ${GIT_QUIET:+--quiet}"
die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$displaypath'")" die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$displaypath'")"
say_msg="$(eval_gettext "Submodule path '\$displaypath': merged in '\$sha1'")" say_msg="$(eval_gettext "Submodule path '\$displaypath': merged in '\$sha1'")"
must_die_on_failure=yes must_die_on_failure=yes

View File

@ -1022,4 +1022,16 @@ test_expect_success 'git clone passes the parallel jobs config on to submodules'
rm -rf super4 rm -rf super4
' '
test_expect_success 'submodule update --quiet passes quietness to merge/rebase' '
(cd super &&
test_commit -C rebasing message &&
git submodule update --rebase --quiet >out 2>err &&
test_must_be_empty out &&
test_must_be_empty err &&
git submodule update --rebase -v >out 2>err &&
test_file_not_empty out &&
test_must_be_empty err
)
'
test_done test_done