t1400: avoid touching refs on filesystem
commitc0e172612754db0ed4c83d82b44fbc61f766ad6f
authorPatrick Steinhardt <ps@pks.im>
Fri, 13 Nov 2020 08:12:31 +0000 (13 09:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Nov 2020 21:44:01 +0000 (16 13:44 -0800)
tree2eb6a2cacc54ecc4b7ebd5636265d88b8734315f
parente4d83eee9239207622e2b1cc43967da5051c189c
t1400: avoid touching refs on filesystem

The testcase t1400 exercises the git-update-ref(1) utility. To do so,
many tests directly read and write references via the filesystem,
assuming that we always use loose and/or packed references. While this
is true now, it'll change with the introduction of the reftable backend.

Convert those tests to use git-update-ref(1) and git-show-ref(1) where
possible. Furthermore, two tests are converted to not delete HEAD
anymore, as this results in a broken repository. They've instead been
updated to create a non-mandatory symbolic reference and delete that
one instead.

Some tests remain which exercise behaviour with broken references, which
cannot currently be converted to use regular git tooling.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1400-update-ref.sh