Re: [PATCH 7/7] cat-file: add --batch-all-objects option
On Mon, Jun 22, 2015 at 6:45 AM, Jeff King <peff@peff.net> wrote:
Show 16 quoted lines
> [...] 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 <peff@peff.net>
> ---
> 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
Show 28 quoted lines
> + # 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.unsorted >expect &&
> + git -C all-two cat-file --batch-all-objects \
> + --batch-check="%(objectname)" >actual.unsorted &&
> + sort <actual.unsorted >actual &&
> + test_cmp expect actual
> +'
> +
> test_done
> --
> 2.4.4.719.g3984bc6