Skip to content

Commit 74339f8

Browse files
committed
Merge branch 'nc/submodule-update-quiet'
"git submodule update --quiet" did not propagate the quiet option down to underlying "git fetch", which has been corrected. * nc/submodule-update-quiet: submodule update: silence underlying fetch with "--quiet"
2 parents 5feebdd + 62af4bd commit 74339f8

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

git-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ fetch_in_submodule () (
420420
cd "$1" &&
421421
if test $# -eq 3
422422
then
423-
echo "$3" | git fetch --stdin ${2:+"$2"}
423+
echo "$3" | git fetch ${GIT_QUIET:+--quiet} --stdin ${2:+"$2"}
424424
else
425-
git fetch ${2:+"$2"}
425+
git fetch ${GIT_QUIET:+--quiet} ${2:+"$2"}
426426
fi
427427
)
428428

t/t7406-submodule-update.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,4 +1037,28 @@ test_expect_success 'submodule update --quiet passes quietness to merge/rebase'
10371037
)
10381038
'
10391039

1040+
test_expect_success 'submodule update --quiet passes quietness to fetch with a shallow clone' '
1041+
test_when_finished "rm -rf super4 super5 super6" &&
1042+
git clone . super4 &&
1043+
(cd super4 &&
1044+
git submodule add --quiet file://"$TRASH_DIRECTORY"/submodule submodule3 &&
1045+
git commit -am "setup submodule3"
1046+
) &&
1047+
(cd submodule &&
1048+
test_commit line6 file
1049+
) &&
1050+
git clone super4 super5 &&
1051+
(cd super5 &&
1052+
git submodule update --quiet --init --depth=1 submodule3 >out 2>err &&
1053+
test_must_be_empty out &&
1054+
test_must_be_empty err
1055+
) &&
1056+
git clone super4 super6 &&
1057+
(cd super6 &&
1058+
git submodule update --init --depth=1 submodule3 >out 2>err &&
1059+
test_file_not_empty out &&
1060+
test_file_not_empty err
1061+
)
1062+
'
1063+
10401064
test_done

0 commit comments

Comments
 (0)