Skip to content

Commit 1320352

Browse files
committed
Merge branch 'jl/submodule-update-quiet' into maint
* jl/submodule-update-quiet: submodule: update and add must honor --quiet flag
2 parents f4af7f1 + 7e60407 commit 1320352

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

git-submodule.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,17 @@ module_clone()
121121
path=$1
122122
url=$2
123123
reference="$3"
124+
quiet=
125+
if test -n "$GIT_QUIET"
126+
then
127+
quiet=-q
128+
fi
124129

125130
if test -n "$reference"
126131
then
127-
git-clone "$reference" -n "$url" "$path"
132+
git-clone $quiet "$reference" -n "$url" "$path"
128133
else
129-
git-clone -n "$url" "$path"
134+
git-clone $quiet -n "$url" "$path"
130135
fi ||
131136
die "Clone of '$url' into submodule path '$path' failed"
132137
}

t/t7400-submodule-basic.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ test_expect_success 'submodule add' '
7777
7878
(
7979
cd addtest &&
80-
git submodule add "$submodurl" submod &&
80+
git submodule add -q "$submodurl" submod >actual &&
81+
test ! -s actual &&
8182
git submodule init
8283
) &&
8384
@@ -275,7 +276,8 @@ test_expect_success 'update should work when path is an empty dir' '
275276
echo "$rev1" >expect &&
276277
277278
mkdir init &&
278-
git submodule update &&
279+
git submodule update -q >update.out &&
280+
test ! -s update.out &&
279281
280282
inspect init &&
281283
test_cmp expect head-sha1

0 commit comments

Comments
 (0)