Skip to content

Commit a858c00

Browse files
author
Junio C Hamano
committed
git-fetch: add --quiet
Pass it to underlying fetch-pack, and also have it affect if -v is passed to http-fetch and rsync. Signed-off-by: Junio C Hamano <[email protected]>
1 parent bd1fc62 commit a858c00

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

git-fetch.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ keep=
2626
shallow_depth=
2727
no_progress=
2828
test -t 1 || no_progress=--no-progress
29+
quiet=
2930
while case "$#" in 0) break ;; esac
3031
do
3132
case "$1" in
@@ -56,6 +57,9 @@ do
5657
--update-head-o|--update-head-ok)
5758
update_head_ok=t
5859
;;
60+
-q|--q|--qu|--qui|--quie|--quiet)
61+
quiet=--quiet
62+
;;
5963
-v|--verbose)
6064
verbose=Yes
6165
;;
@@ -337,7 +341,8 @@ fetch_main () {
337341
expr "z$head" : "z$_x40\$" >/dev/null ||
338342
die "No such ref $remote_name at $remote"
339343
echo >&2 "Fetching $remote_name from $remote using $proto"
340-
git-http-fetch -v -a "$head" "$remote/" || exit
344+
case "$quiet" in '') v=-v ;; *) v= ;; esac
345+
git-http-fetch $v -a "$head" "$remote/" || exit
341346
;;
342347
rsync://*)
343348
test -n "$shallow_depth" &&
@@ -346,8 +351,9 @@ fetch_main () {
346351
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
347352
head=$(git-rev-parse --verify TMP_HEAD)
348353
rm -f "$TMP_HEAD"
354+
case "$quiet" in '') v=-v ;; *) v= ;; esac
349355
test "$rsync_slurped_objects" || {
350-
rsync -av --ignore-existing --exclude info \
356+
rsync -a $v --ignore-existing --exclude info \
351357
"$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
352358
353359
# Look at objects/info/alternates for rsync -- http will
@@ -394,8 +400,8 @@ fetch_main () {
394400
git-bundle unbundle "$remote" $rref ||
395401
echo failed "$remote"
396402
else
397-
git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
398-
"$remote" $rref ||
403+
git-fetch-pack --thin $exec $keep $shallow_depth \
404+
$quiet $no_progress "$remote" $rref ||
399405
echo failed "$remote"
400406
fi
401407
) |

0 commit comments

Comments
 (0)