Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t1006: make hash size independent
author
brian m. carlson
<sandals@crustytoothpaste.net>
Thu, 13 Sep 2018 05:17:37 +0000
(
05:17
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 17 Sep 2018 15:10:32 +0000
(08:10 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1006-cat-file.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1374003
)
diff --git
a/t/t1006-cat-file.sh
b/t/t1006-cat-file.sh
index 7f19d591f250bd61f7d25a5e5e0fae2ca1d8f118..a7c95bb785879f083f469ce1ba7d5d2836cb7906 100755
(executable)
--- a/
t/t1006-cat-file.sh
+++ b/
t/t1006-cat-file.sh
@@
-140,15
+140,17
@@
test_expect_success '--batch-check without %(rest) considers whole line' '
test_cmp expect actual
'
test_cmp expect actual
'
+test_oid_init
+
tree_sha1=$(git write-tree)
tree_sha1=$(git write-tree)
-tree_size=
33
+tree_size=
$(($(test_oid 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)
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_oid 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
commit_content="tree $tree_sha1
author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 0000000000 +0000
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 0000000000 +0000