Am 10.01.19 um 04:28 schrieb Jiang Xin:
SZEDER Gábor <szeder.dev@xxxxxxxxx> 于2019年1月9日周三 下午8:56写道:
Use something like
find .git/objects -type f | grep -v pack >out &&
test_must_be_empty out
instead, so we get an informative error message on failure.
if `grep -v pack` return empty output, it will return error, so
I will use `sed -e "/objects\/pack\//d" >out` instead.
So, you could even write this as
find .git/objects -type f >out &&
! grep -v pack out # must be empty
or
! find .git/objects -type f | grep -v pack
if you want to be terse.
-- Hannes