Skip to content

Commit 27be481

Browse files
author
Junio C Hamano
committed
Merge branch 'js/fetch-progress'
* js/fetch-progress: git-fetch: add --quiet
2 parents d39d10d + a858c00 commit 27be481

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
;;
@@ -173,8 +177,8 @@ fetch_all_at_once () {
173177
git-bundle unbundle "$remote" $rref ||
174178
echo failed "$remote"
175179
else
176-
git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
177-
"$remote" $rref ||
180+
git-fetch-pack --thin $exec $keep $shallow_depth \
181+
$quiet $no_progress "$remote" $rref ||
178182
echo failed "$remote"
179183
fi
180184
) |
@@ -248,7 +252,8 @@ fetch_per_ref () {
248252
expr "z$head" : "z$_x40\$" >/dev/null ||
249253
die "No such ref $remote_name at $remote"
250254
echo >&2 "Fetching $remote_name from $remote using $proto"
251-
git-http-fetch -v -a "$head" "$remote" || exit
255+
case "$quiet" in '') v=-v ;; *) v= ;; esac
256+
git-http-fetch $v -a "$head" "$remote" || exit
252257
;;
253258
rsync://*)
254259
test -n "$shallow_depth" &&
@@ -257,8 +262,9 @@ fetch_per_ref () {
257262
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
258263
head=$(git-rev-parse --verify TMP_HEAD)
259264
rm -f "$TMP_HEAD"
265+
case "$quiet" in '') v=-v ;; *) v= ;; esac
260266
test "$rsync_slurped_objects" || {
261-
rsync -av --ignore-existing --exclude info \
267+
rsync -a $v --ignore-existing --exclude info \
262268
"$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
263269
264270
# Look at objects/info/alternates for rsync -- http will

0 commit comments

Comments
 (0)