Re: [PATCH v4 21/39] t9300: abstract away SHA-1-specific constants

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

 



On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> Adjust the test so that it computes variables for object IDs instead of
> using hard-coded hashes.
>
> Signed-off-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx>
> ---
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> @@ -285,7 +285,7 @@ test_expect_success 'A: verify pack' '
>  test_expect_success 'A: verify diff' '
>         cat >expect <<-EOF &&
> -       :000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A      copy-of-file2
> +       :000000 100755 0000000000000000000000000000000000000000 $(git rev-parse --verify master:file2) A        copy-of-file2
>         EOF

The other changes in this patch all use a variable to hold the
computed OID rather than computing it inline inside the here-doc as is
done here. By assigning it to a variable, a failure of git-rev-parse
will be caught, whereas it won't necessarily be caught failing inside
the here-doc if it happens to produce the correct output before
crashing. Not necessarily worth a re-roll on its own, but maybe worth
doing if you are re-rolling (and would save Denton the effort of
tackling it instead).

> @@ -935,14 +940,15 @@ test_expect_success 'L: verify internal tree sorting' '
> -       test_cmp expect output
> +       cut -d" " -f1,2,5 output >actual &&
> +       test_cmp expect actual

This change is different from all the other changes in this patch. If
you're re-rolling anyhow, perhaps generalize the commit message a bit
to account for it.



[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