From: Eric Sunshine Date: Fri, 26 Jun 2015 06:56:58 GMT Subject: Re: [PATCH 7/7] cat-file: add --batch-all-objects option Message-ID: In-Reply-To: <20150622104559.GG14475@peff.net> On Mon, Jun 22, 2015 at 6:45 AM, Jeff King wrote: > [...] This patch adds an option to > "cat-file --batch-check" to operate on all available > objects (rather than reading names from stdin). > > Signed-off-by: Jeff King > --- > diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh > index 93a4794..2b4220a 100755 > --- a/t/t1006-cat-file.sh > +++ b/t/t1006-cat-file.sh > @@ -547,4 +547,31 @@ test_expect_success 'git cat-file --batch --follow-symlink returns correct sha a > test_cmp expect actual > ' > > +test_expect_success 'cat-file --batch-all-objects shows all objects' ' > + # make new repos so we now the full set of objects; we will s/now/know/ > + # also make sure that there are some packed and some loose > + # objects, some referenced and some not, and that there are > + # some available only via alternates. > + git init all-one && > + ( > + cd all-one && > + echo content >file && > + git add file && > + git commit -qm base && > + git rev-parse HEAD HEAD^{tree} HEAD:file && > + git repack -ad && > + echo not-cloned | git hash-object -w --stdin > + ) >expect.unsorted && > + git clone -s all-one all-two && > + ( > + cd all-two && > + echo local-unref | git hash-object -w --stdin > + ) >>expect.unsorted && > + sort expect && > + git -C all-two cat-file --batch-all-objects \ > + --batch-check="%(objectname)" >actual.unsorted && > + sort actual && > + test_cmp expect actual > +' > + > test_done > -- > 2.4.4.719.g3984bc6