mirror of
https://github.com/git/git
synced 2024-10-01 06:05:20 +00:00
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 <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4e8df1a3c0
commit
9901af48ea
|
@ -121,13 +121,12 @@ test_expect_success 'min/max age uses entry date to limit' '
|
||||||
|
|
||||||
# Create a situation where the reflog and ref database disagree about the latest
|
# Create a situation where the reflog and ref database disagree about the latest
|
||||||
# state of HEAD.
|
# state of HEAD.
|
||||||
test_expect_success REFFILES 'walk prefers reflog to ref tip' '
|
test_expect_success 'walk prefers reflog to ref tip' '
|
||||||
|
test_commit A &&
|
||||||
|
test_commit B &&
|
||||||
|
git reflog delete HEAD@{0} &&
|
||||||
head=$(git rev-parse HEAD) &&
|
head=$(git rev-parse HEAD) &&
|
||||||
one=$(git rev-parse one) &&
|
git rev-parse A >expect &&
|
||||||
ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
|
|
||||||
echo "$head $one $ident broken reflog entry" >>.git/logs/HEAD &&
|
|
||||||
|
|
||||||
echo $one >expect &&
|
|
||||||
git log -g --format=%H -1 >actual &&
|
git log -g --format=%H -1 >actual &&
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
Loading…
Reference in a new issue