t1417: make reflog --updateref tests backend agnostic

The tests for `git reflog delete --updateref` are currently marked to
only run with the reffiles backend. There is no inherent reason that
this should be the case other than the fact that the setup messes with
the on-disk reflogs directly.

Refactor the test to stop doing so and drop the REFFILES prerequisite.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt 2023-11-29 08:24:57 +01:00 committed by Junio C Hamano
parent 88121d9371
commit 7e1fcb81ee

View File

@ -14,9 +14,13 @@ test_expect_success 'setup' '
test_commit B &&
test_commit C &&
cp .git/logs/HEAD HEAD.old &&
git reflog HEAD >expect &&
git reset --hard HEAD~ &&
cp HEAD.old .git/logs/HEAD
# Make sure that the reflog does not point to the same commit
# as HEAD.
git reflog delete HEAD@{0} &&
git reflog HEAD >actual &&
test_cmp expect actual
)
'
@ -25,7 +29,7 @@ test_reflog_updateref () {
shift
args="$@"
test_expect_success REFFILES "get '$exp' with '$args'" '
test_expect_success "get '$exp' with '$args'" '
test_when_finished "rm -rf copy" &&
cp -R repo copy &&