Skip to content

Commit 129a169

Browse files
pks-tgitster
authored andcommitted
t1400: exercise reflog with gaps with reftable backend
In t1400, we have a test that exercises whether we print a warning message as expected when the reflog contains entries which have a gap between the old entry's new object ID and the new entry's old object ID. While the logic should apply to all ref backends, the test setup writes into `.git/logs` directly and is thus "files"-backend specific. Refactor the test to instead use `git reflog delete` to create the gap and drop the REFFILES prerequisite. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e988398 commit 129a169

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

t/t1400-update-ref.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,15 @@ test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
426426
rm -f expect
427427
git update-ref -d $m
428428

429-
test_expect_success REFFILES 'query reflog with gap' '
429+
test_expect_success 'query reflog with gap' '
430430
test_when_finished "git update-ref -d $m" &&
431431
432-
git update-ref $m $F &&
433-
cat >.git/logs/$m <<-EOF &&
434-
$Z $A $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150320 -0500
435-
$A $B $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150380 -0500
436-
$D $F $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150680 -0500
437-
EOF
432+
GIT_COMMITTER_DATE="1117150320 -0500" git update-ref $m $A &&
433+
GIT_COMMITTER_DATE="1117150380 -0500" git update-ref $m $B &&
434+
GIT_COMMITTER_DATE="1117150480 -0500" git update-ref $m $C &&
435+
GIT_COMMITTER_DATE="1117150580 -0500" git update-ref $m $D &&
436+
GIT_COMMITTER_DATE="1117150680 -0500" git update-ref $m $F &&
437+
git reflog delete $m@{2} &&
438438
439439
git rev-parse --verify "main@{2005-05-26 23:33:01}" >actual 2>stderr &&
440440
echo "$B" >expect &&

0 commit comments

Comments
 (0)