diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-17 11:13:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-17 08:40:26 -0700 |
commit | f818f7f725e4a49296e9e28cf3bb26aa8a1bf3ba (patch) | |
tree | 9775102a3266f4b02c5d20e0e9fb0c2a91752dc7 /t/chainlint | |
parent | bugreport tests: tighten up "git bugreport -s hooks" test (diff) | |
download | tgif-f818f7f725e4a49296e9e28cf3bb26aa8a1bf3ba.tar.xz |
fetch+push tests: use "test_hook" and "test_when_finished" pattern
Change the "t5516-fetch-push.sh" test code to make use of the new
"test_hook" helper, and to use "test_when_finished" to have tests
clean up their own state, instead of relying on subsequent tests to
clean the trash directory.
Before this each test would have been responsible for cleaning up
after a preceding test (which may or may not have run, e.g. if --run
or "GIT_SKIP_TESTS" was used), now each test will instead clean up
after itself.
In order to use both "test_hook" and "test_when_finished" we need to
move them out of sub-shells, which requires some refactoring.
While we're at it split up the "push with negotiation" test, now the
middle of the test doesn't need to "rm event", and since it delimited
two halves that were testing two different things the end-state is
easier to read and reason about.
While changing these lines make the minor change from "-fr" to "-rf"
as the "rm" argument, some of them used it already, it's more common
in the test suite, and it leaves the end-state of the file with more
consistency.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint')
0 files changed, 0 insertions, 0 deletions