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>
brian m. carlson committed
Mar 25, 2018 at 19:20 UTC
d3438d1a09c35e4c9cffd14aa67fa9722559e87a
1 file changed
+11
-10
t/t1411-reflog-show.sh
+11
-10
@@ -10,6 +10,7 @@ test_expect_success 'setup' '
10
git commit -m one
11
'
12
13
+commit=$(git rev-parse --short HEAD)
14
cat >expect <<'EOF'
15
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
16
Reflog message: commit (initial): one
@@ -20,8 +21,8 @@ test_expect_success 'log -g shows reflog headers' '
21
test_cmp expect actual
22
'
23
23
-cat >expect <<'EOF'
24
-e46513e HEAD@{0}: commit (initial): one
24
+cat >expect <<EOF
25
+$commit HEAD@{0}: commit (initial): one
26
EOF
27
test_expect_success 'oneline reflog format' '
28
git log -g -1 --oneline >actual &&
@@ -33,8 +34,8 @@ test_expect_success 'reflog default format' '
34
test_cmp expect actual
35
'
36
36
-cat >expect <<'EOF'
37
-commit e46513e
37
+cat >expect <<EOF
38
+commit $commit
39
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
40
Reflog message: commit (initial): one
41
Author: A U Thor <author@example.com>
@@ -56,8 +57,8 @@ test_expect_success 'using @{now} syntax shows reflog date (multiline)' '
57
test_cmp expect actual
58
'
59
59
-cat >expect <<'EOF'
60
-e46513e HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
60
+cat >expect <<EOF
61
+$commit HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
62
EOF
63
test_expect_success 'using @{now} syntax shows reflog date (oneline)' '
64
git log -g -1 --oneline HEAD@{now} >actual &&
@@ -82,8 +83,8 @@ test_expect_success 'using --date= shows reflog date (multiline)' '
83
test_cmp expect actual
84
'
85
85
-cat >expect <<'EOF'
86
-e46513e HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
86
+cat >expect <<EOF
87
+$commit HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
88
EOF
89
test_expect_success 'using --date= shows reflog date (oneline)' '
90
git log -g -1 --oneline --date=default >actual &&
@@ -109,8 +110,8 @@ test_expect_success 'log.date does not invoke "--date" magic (multiline)' '
110
test_cmp expect actual
111
'
112
112
-cat >expect <<'EOF'
113
-e46513e HEAD@{0}: commit (initial): one
113
+cat >expect <<EOF
114
+$commit HEAD@{0}: commit (initial): one
115
EOF
116
test_expect_success 'log.date does not invoke "--date" magic (oneline)' '
117
test_config log.date raw &&