t2011: exercise D/F conflicts with HEAD with the reftable backend
commitf85a032c676b818851926044aaea2e9065acdaa2
authorPatrick Steinhardt <ps@pks.im>
Thu, 15 Feb 2024 08:25:51 +0000 (15 09:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Feb 2024 18:12:30 +0000 (15 10:12 -0800)
tree2583998cc8a0c63482fe549be7ea845776fbb964
parentc4e3af6d97d27148b638ad09ff8eebd682aecacf
t2011: exercise D/F conflicts with HEAD with the reftable backend

Some of the tests in t2011 exercise whether it is possible to move away
from a symbolic HEAD ref whose target ref has a directory-file conflict
with another, preexisting ref. These tests don't use git-symbolic-ref(1)
but manually write HEAD. This is supposedly done to avoid using logic
that we're about to exercise, but it makes it impossible to verify
whether the logic also works for ref backends other than "files".

Refactor the code to use git-symbolic-ref(1) instead so that the tests
work with the "reftable" backend, as well. We already have lots of tests
in t1404 that ensure that both git-update-ref(1) and git-symbolic-ref(1)
work in such a scenario, so it should be safe to rely on it here.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2011-checkout-invalid-head.sh