Re: [PATCH v2 1/7] fetch: increase test coverage of fetches
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Feb 17, 2022, 15:18 UTC
- Message-ID
- <CAP8UFD2kr6WJvv7eoDvytx5Q982XBXTpSTUQw5hXmRrDm-UuBw@mail.gmail.com>
- In-Reply-To
- <b4ca3f1f3baacde2aea7bae4f583f68c211a557a.1645102965.git.ps@pks.im>
On Thu, Feb 17, 2022 at 2:04 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 16 quoted lines
> +test_expect_success 'atomic fetch with failing backfill' ' > + git init clone3 && > + > + # We want to test whether a failure when backfilling tags correctly > + # aborts the complete transaction when `--atomic` is passed: we should > + # neither create the branch nor should we create the tag when either > + # one of both fails to update correctly. > + # > + # To trigger failure we simply abort when backfilling a tag. > + write_script clone3/.git/hooks/reference-transaction <<-\EOF && > + while read oldrev newrev reference > + do > + if test "$reference" = refs/tags/tag1 > + then > + exit 1 > + fi
Maybe the following could save a few lines:
test "$reference" = refs/tags/tag1 && exit 1
It would make the code look a bit different than in another hook script written below though, so not a big deal.
> + done > + EOF
Overall it looks good, and I like the improved commit message!