[PATCH 06/10] t1006: make hash size independent
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jun 4, 2018, 23:52 UTC
- Message-ID
- <20180604235229.279814-7-sandals@crustytoothpaste.net>
- In-Reply-To
- <20180604235229.279814-1-sandals@crustytoothpaste.net>
Compute the size of the tree and commit objects we're creating by checking for the size of an object ID and computing the resulting sizes accordingly.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- t/t1006-cat-file.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh index 13dd510b2e..3b82051e2b 100755 --- a/t/t1006-cat-file.sh +++ b/t/t1006-cat-file.sh @@ -141,14 +141,14 @@ test_expect_success '--batch-check without %(rest) considers whole line' ' ' tree_sha1=$(git write-tree) -tree_size=33 +tree_size=$(($(test_translate -f hash-info rawsz) + 13)) tree_pretty_content="100644 blob $hello_sha1 hello" run_tests 'tree' $tree_sha1 $tree_size "" "$tree_pretty_content" commit_message="Initial commit" commit_sha1=$(echo_without_newline "$commit_message" | git commit-tree $tree_sha1) -commit_size=177 +commit_size=$(($(test_translate -f hash-info hexsz) + 137)) commit_content="tree $tree_sha1 author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 0000000000 +0000 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 0000000000 +0000