Re: [PATCH] builtin/repack.c: invalidate MIDX only when necessary
- From
Jeff King <peff@peff.net>
- Date
- Aug 25, 2020, 16:56 UTC
- Message-ID
- <20200825165642.GB1414394@coredump.intra.peff.net>
- In-Reply-To
- <20200825154224.GA9116@syl.lan>
On Tue, Aug 25, 2020 at 11:42:24AM -0400, Taylor Blau wrote:
Show 15 quoted lines
> > test_expect_success 'repack preserves multi-pack-index when deleting unknown packs' ' > > git init preserve && > > test_when_finished "rm -fr preserve" && > > ( > > cd preserve && > > midx=.git/objects/pack/multi-pack-index && > > > > test_commit 1 && > > HASH1=$(git pack-objects --all .git/objects/pack/pack) && > > touch .git/objects/pack/pack-$HASH1.keep && > > > > cat >pack-input <<-\EOF && > > Escaping the heredoc shouldn't be necessary, so this can be written > instead as '<<-EOF'.
We usually go the opposite way: if a here-doc doesn't need interpolation, then we prefer to mark it as such to avoid surprising somebody who adds lines later (and might need quoting).
Certainly you can argue that least-surprise would be in the other direction (i.e., people expect to interpolate by default, and you surprise anybody adding a variable reference), but for Git's test suite, the convention usually runs the other way.
-Peff