1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 08:47:56 +01:00
git/git-count-objects.sh
Junio C Hamano d6a461e177 count-objects: squelch error from find on sparse object directory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-19 15:01:50 -07:00

13 lines
358 B
Bash
Executable file

#!/bin/sh
. git-sh-setup
echo $(find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null | wc -l) objects, \
$({
echo 0
# "no-such" is to help Darwin folks by not using xargs -r.
find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null |
xargs du -k "$GIT_DIR/objects/no-such" 2>/dev/null |
sed -e 's/[ ].*/ +/'
echo p
} | dc) kilobytes