Re: [PATCH 7/7] cat-file: add --batch-all-objects option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 22, 2015 at 6:45 AM, Jeff King <peff@xxxxxxxx> 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 <peff@xxxxxxxx>
> ---
> 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.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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]