Skip to content

Commit

Permalink
Silence cpio's "N blocks" output when cloning locally
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan Donlan authored and Junio C Hamano committed Mar 31, 2008
1 parent 67dac28 commit c20711d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ yes)
mkdir -p "$GIT_DIR/objects/info"
echo "$repo/objects" >>"$GIT_DIR/objects/info/alternates"
else
cpio_quiet_flag=""
cpio --help 2>&1 | grep -- --quiet >/dev/null && \
cpio_quiet_flag=--quiet
l= &&
if test "$use_local_hardlink" = yes
then
Expand All @@ -330,7 +333,8 @@ yes)
fi
fi &&
cd "$repo" &&
find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
exit 1
fi
git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
;;
Expand Down

0 comments on commit c20711d

Please sign in to comment.