Re: [PATCH v3 11/24] midx: read pack names into array
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 6, 2018, 04:58 UTC
- Message-ID
- <CAPig+cQ2cz8H9qYn09g1o-ZAVQc98Z=hD9R0c7pfha257BsX3w@mail.gmail.com>
- In-Reply-To
- <20180706005321.124643-12-dstolee@microsoft.com>
On Thu, Jul 5, 2018 at 8:54 PM Derrick Stolee <stolee@gmail.com> wrote:
Show 5 quoted lines
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
> diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
> @@ -8,8 +8,13 @@ midx_read_expect () {
> cat >expect <<-EOFBroken &&-chain.
Show 6 quoted lines
> header: 4d494458 1 1 $NUM_PACKS > chunks: pack_names > - object_dir: . > + packs: > EOF > + if [ $NUM_PACKS -ge 1 ]
On this project, use 'test' rather than '['.
> + then > + ls pack/ | grep idx | sort >> expect > + fi
Broken &&-chain.
> + printf "object_dir: .\n" >>expect &&
All this code building up 'expect' could be in a {...} block to make it clearer and less noisy:
{
cat <<-EOF &&
...
EOF
if test $NUM_PACKS -ge 1
then
ls -1 pack/ | ...
fi &&
printf "..."
} >expect &&And, some pointless bike-shedding while here: perhaps dashes instead of underlines? "pack-names", "object-dir"
> test-tool read-midx . >actual && > test_cmp expect actual > }