t5304: use "reflog expire --all" to clear the reflog
commitd491f5ea07e5bb85be75060d3939894892f9478a
authorHan-Wen Nienhuys <hanwen@google.com>
Mon, 31 May 2021 16:56:28 +0000 (31 16:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jun 2021 01:01:54 +0000 (2 10:01 +0900)
tree4a0f2f15efd3c7de48babdd333a3168962fd1e91
parent1fa9cf6ea14eba36d72eb48e82069012c6c8af90
t5304: use "reflog expire --all" to clear the reflog

This test checks that unreachable objects are really removed. For the test to
work, it has to ensure that no reflog retain any reachable objects.

Previously, it did this by manipulating the file system to remove reflog in the
first test, and relying on git not updating the reflog if the relevant logfile
doesn't exist in follow-up tests.

Now, explicitly clear the reflog using 'reflog expire'. This reduces the
dependency between test functions. It also is more amenable to use with
reftable, which has no concept of (non)-existence of a reflog

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5304-prune.sh