]> git.ipfire.org Git - thirdparty/git.git/commit
t: convert tests to not write references via the filesystem
authorPatrick Steinhardt <ps@pks.im>
Thu, 2 Nov 2023 08:46:45 +0000 (09:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 23:37:06 +0000 (08:37 +0900)
commit1c6667cb9dab6f90dcc3381676b50b1f131aeda5
tree6ea16916ee239d9d940805050d0dcfd0d16477d4
parent9ddd5b883b0221d80392a914eb621ea680476e75
t: convert tests to not write references via the filesystem

Some of our tests manually create, update or delete references by
writing the respective new values into the filesystem directly. While
this works with the current files reference backend, this will break
once we have a second reference backend implementation in our codebase.

Refactor these tests to instead use git-update-ref(1) or our `ref-store`
test tool. The latter is required in some cases where safety checks of
git-update-ref(1) would otherwise reject a reference update.

While at it, refactor some of the tests to schedule the cleanup command
via `test_when_finished` before modifying the repository.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1400-update-ref.sh
t/t1450-fsck.sh
t/t3404-rebase-interactive.sh
t/t5526-fetch-submodules.sh