From: Alexey Shumkin Date: Thu, 24 Jan 2013 09:10:25 GMT Subject: [PATCH v4 1/4] t6006 (rev-list-format): don't hardcode SHA-1 in expected outputs Message-ID: In-Reply-To: The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Alexey Shumkin --- t/t6006-rev-list-format.sh | 130 +++++++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 58 deletions(-) diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index f94f0c4..c248509 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -6,8 +6,19 @@ test_description='git rev-list --pretty=format test' test_tick test_expect_success 'setup' ' -touch foo && git add foo && git commit -m "added foo" && - echo changed >foo && git commit -a -m "changed foo" + touch foo && + git add foo && + git commit -m "added foo" && + head1=$(git rev-parse --verify HEAD) && + head1_7=$(echo $head1 | cut -c1-7) && + echo changed >foo && + git commit -a -m "changed foo" && + head2=$(git rev-parse --verify HEAD) && + head2_7=$(echo $head2 | cut -c1-7) && + head2_parent=$(git cat-file -p HEAD | grep parent | cut -f 2 -d" ") && + head2_parent_7=$(echo $head2_parent | cut -c1-7) && + tree2=$(git cat-file -p HEAD | grep tree | cut -f 2 -d" ") && + tree2_7=$(echo $tree2 | cut -c1-7) ' # usage: test_format name format_string foo && git commit -a -F commit-msg + git config i18n.commitencoding iso8859-1 && + echo change2 >foo && git commit -a -F commit-msg && + head3=$(git rev-parse --verify HEAD) && + head3_7=$(echo $head3 | cut -c1-7) ' -test_format complex-encoding %e <<'EOF' -commit f58db70b055c5718631e5c61528b28b12090cdea +test_format complex-encoding %e <expect commit f58db70b055c5718631e5c61528b28b12090cdea && + echo >expect commit $head3 && echo >>expect fooQbar && git rev-list -1 --format=foo%x00bar HEAD >actual.nul && nul_to_q actual && -- 1.8.1.1.10.g9255f3f