Skip to content

Commit 9901af4

Browse files
john-caigitster
authored andcommitted
t1414: convert test to use Git commands instead of writing refs manually
This test can be re-written to use Git commands rather than writing a manual ref in the reflog. This way this test no longer needs the REFFILES prerequisite. Signed-off-by: John Cai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4e8df1a commit 9901af4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

t/t1414-reflog-walk.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,12 @@ test_expect_success 'min/max age uses entry date to limit' '
121121

122122
# Create a situation where the reflog and ref database disagree about the latest
123123
# state of HEAD.
124-
test_expect_success REFFILES 'walk prefers reflog to ref tip' '
124+
test_expect_success 'walk prefers reflog to ref tip' '
125+
test_commit A &&
126+
test_commit B &&
127+
git reflog delete HEAD@{0} &&
125128
head=$(git rev-parse HEAD) &&
126-
one=$(git rev-parse one) &&
127-
ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
128-
echo "$head $one $ident broken reflog entry" >>.git/logs/HEAD &&
129-
130-
echo $one >expect &&
129+
git rev-parse A >expect &&
131130
git log -g --format=%H -1 >actual &&
132131
test_cmp expect actual
133132
'

0 commit comments

Comments
 (0)