Silence cpio's "N blocks" output when cloning locally
Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" message. For compatibility with operating systems which might not support GNUisms, the presence of --quiet is probed for by grepping cpio's --help output. Signed-off-by: Bryan Donlan <bdonlan@fushizen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Bryan Donlan committed
Mar 28, 2008 at 02:19 UTC
c20711d29dff054735988c84ad5fe4f382d064cf
1 file changed
+5
-1
git-clone.sh
+5
-1
@@ -310,6 +310,9 @@ yes)
310
mkdir -p "$GIT_DIR/objects/info"
311
echo "$repo/objects" >>"$GIT_DIR/objects/info/alternates"
312
else
313
+ cpio_quiet_flag=""
314
+ cpio --help 2>&1 | grep -- --quiet >/dev/null && \
315
+ cpio_quiet_flag=--quiet
316
l= &&
317
if test "$use_local_hardlink" = yes
318
then
@@ -330,7 +333,8 @@ yes)
333
fi
334
fi &&
335
cd "$repo" &&
333
- find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
336
+ find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
337
+ exit 1
338
fi
339
git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
340
;;