summaryrefslogtreecommitdiff
path: root/t/t4205-log-pretty-formats.sh
diff options
context:
space:
mode:
authorAlexey Shumkin <Alex.Crezoff@gmail.com>2013-06-26 10:19:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-26 18:33:00 (GMT)
commita742f2a0a7e57bb7d3f55cb8312c3f4cc4dc68fb (patch)
treea2af75a8d975fbc8b819c19b52fd717b728bcdca /t/t4205-log-pretty-formats.sh
parent375775bb1289a0b78f26b8ec08627fd133920ab9 (diff)
downloadgit-a742f2a0a7e57bb7d3f55cb8312c3f4cc4dc68fb.zip
git-a742f2a0a7e57bb7d3f55cb8312c3f4cc4dc68fb.tar.gz
git-a742f2a0a7e57bb7d3f55cb8312c3f4cc4dc68fb.tar.bz2
t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4205-log-pretty-formats.sh')
-rwxr-xr-xt/t4205-log-pretty-formats.sh48
1 files changed, 26 insertions, 22 deletions
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 26fbfde..73ba5e8 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -101,7 +101,11 @@ test_expect_failure 'NUL termination with --stat' '
test_expect_success 'setup more commits' '
test_commit "message one" one one message-one &&
- test_commit "message two" two two message-two
+ test_commit "message two" two two message-two &&
+ head1=$(git rev-parse --verify --short HEAD~0) &&
+ head2=$(git rev-parse --verify --short HEAD~1) &&
+ head3=$(git rev-parse --verify --short HEAD~2) &&
+ head4=$(git rev-parse --verify --short HEAD~3)
'
test_expect_success 'left alignment formatting' '
@@ -117,18 +121,18 @@ EOF
test_cmp expected actual
'
-test_expect_success 'left alignment formatting at the nth column' '
- git log --pretty="format:%h %<|(40)%s" >actual &&
+test_expect_success 'left alignment formatting at the nth column' "
+ git log --pretty='format:%h %<|(40)%s' >actual &&
# complete the incomplete line at the end
echo >>actual &&
qz_to_tab_space <<\EOF >expected &&
-fa33ab1 message two Z
-7cd6c63 message one Z
-1711bf9 add bar Z
-af20c06 initial Z
+$head1 message two Z
+$head2 message one Z
+$head3 add bar Z
+$head4 initial Z
EOF
test_cmp expected actual
-'
+"
test_expect_success 'left alignment formatting with no padding' '
git log --pretty="format:%<(1)%s" >actual &&
@@ -195,18 +199,18 @@ EOF
test_cmp expected actual
'
-test_expect_success 'right alignment formatting at the nth column' '
- git log --pretty="format:%h %>|(40)%s" >actual &&
+test_expect_success 'right alignment formatting at the nth column' "
+ git log --pretty='format:%h %>|(40)%s' >actual &&
# complete the incomplete line at the end
echo >>actual &&
qz_to_tab_space <<\EOF >expected &&
-fa33ab1 message two
-7cd6c63 message one
-1711bf9 add bar
-af20c06 initial
+$head1 message two
+$head2 message one
+$head3 add bar
+$head4 initial
EOF
test_cmp expected actual
-'
+"
test_expect_success 'right alignment formatting with no padding' '
git log --pretty="format:%>(1)%s" >actual &&
@@ -234,18 +238,18 @@ EOF
test_cmp expected actual
'
-test_expect_success 'center alignment formatting at the nth column' '
- git log --pretty="format:%h %><|(40)%s" >actual &&
+test_expect_success 'center alignment formatting at the nth column' "
+ git log --pretty='format:%h %><|(40)%s' >actual &&
# complete the incomplete line at the end
echo >>actual &&
qz_to_tab_space <<\EOF >expected &&
-fa33ab1 message two Z
-7cd6c63 message one Z
-1711bf9 add bar Z
-af20c06 initial Z
+$head1 message two Z
+$head2 message one Z
+$head3 add bar Z
+$head4 initial Z
EOF
test_cmp expected actual
-'
+"
test_expect_success 'center alignment formatting with no padding' '
git log --pretty="format:%><(1)%s" >actual &&