Skip to content

Commit 1896562

Browse files
committed
Merge branch 'jb/t8008-cleanup'
Code clean-up. * jb/t8008-cleanup: t8008: rely on rev-parse'd HEAD instead of sha1 value
2 parents 9a8ff89 + 0ba9c9a commit 1896562

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

t/t8008-blame-formats.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@ test_expect_success 'setup' '
1212
echo c >>file &&
1313
echo d >>file &&
1414
test_tick &&
15-
git commit -a -m two
15+
git commit -a -m two &&
16+
ID1=$(git rev-parse HEAD^) &&
17+
shortID1="^$(git rev-parse HEAD^ |cut -c 1-17)" &&
18+
ID2=$(git rev-parse HEAD) &&
19+
shortID2="$(git rev-parse HEAD |cut -c 1-18)"
1620
'
1721

18-
cat >expect <<'EOF'
19-
^baf5e0b (A U Thor 2005-04-07 15:13:13 -0700 1) a
20-
8825379d (A U Thor 2005-04-07 15:14:13 -0700 2) b
21-
8825379d (A U Thor 2005-04-07 15:14:13 -0700 3) c
22-
8825379d (A U Thor 2005-04-07 15:14:13 -0700 4) d
22+
cat >expect <<EOF
23+
$shortID1 (A U Thor 2005-04-07 15:13:13 -0700 1) a
24+
$shortID2 (A U Thor 2005-04-07 15:14:13 -0700 2) b
25+
$shortID2 (A U Thor 2005-04-07 15:14:13 -0700 3) c
26+
$shortID2 (A U Thor 2005-04-07 15:14:13 -0700 4) d
2327
EOF
2428
test_expect_success 'normal blame output' '
25-
git blame file >actual &&
29+
git blame --abbrev=17 file >actual &&
2630
test_cmp expect actual
2731
'
2832

29-
ID1=baf5e0b3869e0b2b2beb395a3720c7b51eac94fc
30-
COMMIT1='author A U Thor
33+
COMMIT1="author A U Thor
3134
author-mail <[email protected]>
3235
author-time 1112911993
3336
author-tz -0700
@@ -37,9 +40,8 @@ committer-time 1112911993
3740
committer-tz -0700
3841
summary one
3942
boundary
40-
filename file'
41-
ID2=8825379dfb8a1267b58e8e5bcf69eec838f685ec
42-
COMMIT2='author A U Thor
43+
filename file"
44+
COMMIT2="author A U Thor
4345
author-mail <[email protected]>
4446
author-time 1112912053
4547
author-tz -0700
@@ -48,8 +50,8 @@ committer-mail <[email protected]>
4850
committer-time 1112912053
4951
committer-tz -0700
5052
summary two
51-
previous baf5e0b3869e0b2b2beb395a3720c7b51eac94fc file
52-
filename file'
53+
previous $ID1 file
54+
filename file"
5355

5456
cat >expect <<EOF
5557
$ID1 1 1 1

0 commit comments

Comments
 (0)