Re: [PATCH v3 31/39] bundle: add new version for use with SHA-256

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

 



On Thu, Jul 23, 2020 at 1:31 AM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Wed, Jul 22, 2020 at 9:10 PM brian m. carlson
> <sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> > +test_expect_success 'git bundle v3 rejects unknown extensions' '

By the way, should this be s/extensions/capabilities/ ?

> > +       head -n2 bundle >new &&
> > +       echo "@unknown=silly" >>new &&
> > +       sed "1,2d" bundle >>new &&
> > +       test_must_fail git bundle verify new 2>output &&
> > +       test_i18ngrep "unknown capability .unknown=silly." output
> > +'
>
> I worry about passing binary bundle data through 'sed' like this.

Thinking on this further: Since you are only interested in whether or
not "git bundle verify" correctly complains about the unknown
capabilities, you really don't even need any of the binary bundle data
which follows the header. As such, you could just hand-craft the bogus
bundle, perhaps like this:

    cat >new <<\-EOF &&
    # v3 git bundle
    @object-format=sha256
    @unknown=silly
    EOF
    test_must_fail git bundle verify new 2>output &&
    test_i18ngrep "unknown capability .unknown=silly." output



[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]

  Powered by Linux