Skip to content

Commit d3438d1

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 64af775 commit d3438d1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

t/t1411-reflog-show.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test_expect_success 'setup' '
1010
git commit -m one
1111
'
1212

13+
commit=$(git rev-parse --short HEAD)
1314
cat >expect <<'EOF'
1415
Reflog: HEAD@{0} (C O Mitter <[email protected]>)
1516
Reflog message: commit (initial): one
@@ -20,8 +21,8 @@ test_expect_success 'log -g shows reflog headers' '
2021
test_cmp expect actual
2122
'
2223

23-
cat >expect <<'EOF'
24-
e46513e HEAD@{0}: commit (initial): one
24+
cat >expect <<EOF
25+
$commit HEAD@{0}: commit (initial): one
2526
EOF
2627
test_expect_success 'oneline reflog format' '
2728
git log -g -1 --oneline >actual &&
@@ -33,8 +34,8 @@ test_expect_success 'reflog default format' '
3334
test_cmp expect actual
3435
'
3536

36-
cat >expect <<'EOF'
37-
commit e46513e
37+
cat >expect <<EOF
38+
commit $commit
3839
Reflog: HEAD@{0} (C O Mitter <[email protected]>)
3940
Reflog message: commit (initial): one
4041
Author: A U Thor <[email protected]>
@@ -56,8 +57,8 @@ test_expect_success 'using @{now} syntax shows reflog date (multiline)' '
5657
test_cmp expect actual
5758
'
5859

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
6162
EOF
6263
test_expect_success 'using @{now} syntax shows reflog date (oneline)' '
6364
git log -g -1 --oneline HEAD@{now} >actual &&
@@ -82,8 +83,8 @@ test_expect_success 'using --date= shows reflog date (multiline)' '
8283
test_cmp expect actual
8384
'
8485

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
8788
EOF
8889
test_expect_success 'using --date= shows reflog date (oneline)' '
8990
git log -g -1 --oneline --date=default >actual &&
@@ -109,8 +110,8 @@ test_expect_success 'log.date does not invoke "--date" magic (multiline)' '
109110
test_cmp expect actual
110111
'
111112

112-
cat >expect <<'EOF'
113-
e46513e HEAD@{0}: commit (initial): one
113+
cat >expect <<EOF
114+
$commit HEAD@{0}: commit (initial): one
114115
EOF
115116
test_expect_success 'log.date does not invoke "--date" magic (oneline)' '
116117
test_config log.date raw &&

0 commit comments

Comments
 (0)