Skip to content

Commit 7e1fcb8

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88121d9 commit 7e1fcb8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/t1417-reflog-updateref.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ test_expect_success 'setup' '
1414
test_commit B &&
1515
test_commit C &&
1616
17-
cp .git/logs/HEAD HEAD.old &&
17+
git reflog HEAD >expect &&
1818
git reset --hard HEAD~ &&
19-
cp HEAD.old .git/logs/HEAD
19+
# Make sure that the reflog does not point to the same commit
20+
# as HEAD.
21+
git reflog delete HEAD@{0} &&
22+
git reflog HEAD >actual &&
23+
test_cmp expect actual
2024
)
2125
'
2226

@@ -25,7 +29,7 @@ test_reflog_updateref () {
2529
shift
2630
args="$@"
2731

28-
test_expect_success REFFILES "get '$exp' with '$args'" '
32+
test_expect_success "get '$exp' with '$args'" '
2933
test_when_finished "rm -rf copy" &&
3034
cp -R repo copy &&
3135

0 commit comments

Comments
 (0)