On Thu, Feb 17, 2022 at 2:04 PM Patrick Steinhardt <ps@xxxxxx> wrote: > +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!