Re: [PATCH v4 21/39] t9300: abstract away SHA-1-specific constants
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 26, 2020, 23:14 UTC
- Message-ID
- <CAPig+cRfvEa72_L5UFwSngWE7TNd9jWYEE2e_8bDOYQe3sSMfw@mail.gmail.com>
- In-Reply-To
- <20200726195424.626969-22-sandals@crustytoothpaste.net>
On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 12 quoted lines
> Adjust the test so that it computes variables for object IDs instead of > using hard-coded hashes. > > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> > --- > 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.