From: Johannes Sixt Date: Thu, 10 Jan 2019 07:11:28 GMT Subject: Re: [PATCH v3 1/3] t5323: test cases for git-pack-redundant Message-ID: <74412c28-936a-5276-d6ca-db7d8c5c2124@kdbg.org> In-Reply-To: Am 10.01.19 um 04:28 schrieb Jiang Xin: > SZEDER Gábor 于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