Skip to content

Commit c20711d

Browse files
Bryan Donlangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 67dac28 commit c20711d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-clone.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ yes)
310310
mkdir -p "$GIT_DIR/objects/info"
311311
echo "$repo/objects" >>"$GIT_DIR/objects/info/alternates"
312312
else
313+
cpio_quiet_flag=""
314+
cpio --help 2>&1 | grep -- --quiet >/dev/null && \
315+
cpio_quiet_flag=--quiet
313316
l= &&
314317
if test "$use_local_hardlink" = yes
315318
then
@@ -330,7 +333,8 @@ yes)
330333
fi
331334
fi &&
332335
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
334338
fi
335339
git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
336340
;;

0 commit comments

Comments
 (0)