t1411: abstract away SHA-1-specific constants
Adjust the test so that it uses a variable consisting of the current HEAD instead of a hard-coded hash. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
64af7752bb
commit
d3438d1a09
@ -10,6 +10,7 @@ test_expect_success 'setup' '
|
|||||||
git commit -m one
|
git commit -m one
|
||||||
'
|
'
|
||||||
|
|
||||||
|
commit=$(git rev-parse --short HEAD)
|
||||||
cat >expect <<'EOF'
|
cat >expect <<'EOF'
|
||||||
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
|
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
|
||||||
Reflog message: commit (initial): one
|
Reflog message: commit (initial): one
|
||||||
@ -20,8 +21,8 @@ test_expect_success 'log -g shows reflog headers' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
e46513e HEAD@{0}: commit (initial): one
|
$commit HEAD@{0}: commit (initial): one
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'oneline reflog format' '
|
test_expect_success 'oneline reflog format' '
|
||||||
git log -g -1 --oneline >actual &&
|
git log -g -1 --oneline >actual &&
|
||||||
@ -33,8 +34,8 @@ test_expect_success 'reflog default format' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
commit e46513e
|
commit $commit
|
||||||
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
|
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
|
||||||
Reflog message: commit (initial): one
|
Reflog message: commit (initial): one
|
||||||
Author: A U Thor <author@example.com>
|
Author: A U Thor <author@example.com>
|
||||||
@ -56,8 +57,8 @@ test_expect_success 'using @{now} syntax shows reflog date (multiline)' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
e46513e HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
|
$commit HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'using @{now} syntax shows reflog date (oneline)' '
|
test_expect_success 'using @{now} syntax shows reflog date (oneline)' '
|
||||||
git log -g -1 --oneline HEAD@{now} >actual &&
|
git log -g -1 --oneline HEAD@{now} >actual &&
|
||||||
@ -82,8 +83,8 @@ test_expect_success 'using --date= shows reflog date (multiline)' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
e46513e HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
|
$commit HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'using --date= shows reflog date (oneline)' '
|
test_expect_success 'using --date= shows reflog date (oneline)' '
|
||||||
git log -g -1 --oneline --date=default >actual &&
|
git log -g -1 --oneline --date=default >actual &&
|
||||||
@ -109,8 +110,8 @@ test_expect_success 'log.date does not invoke "--date" magic (multiline)' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
e46513e HEAD@{0}: commit (initial): one
|
$commit HEAD@{0}: commit (initial): one
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'log.date does not invoke "--date" magic (oneline)' '
|
test_expect_success 'log.date does not invoke "--date" magic (oneline)' '
|
||||||
test_config log.date raw &&
|
test_config log.date raw &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user