summaryrefslogtreecommitdiff
path: root/t/t5000-tar-tree.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-06-28 22:59:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-01 20:28:18 (GMT)
commit0b78a1b22a4461b1909b0716d1572d2119d1c450 (patch)
tree810c4f930a4ed6f1eb8e3c82ea867d02c7dccd0e /t/t5000-tar-tree.sh
parent8de6b383c15a527c222688161156eb5c5acfecc4 (diff)
downloadgit-0b78a1b22a4461b1909b0716d1572d2119d1c450.zip
git-0b78a1b22a4461b1909b0716d1572d2119d1c450.tar.gz
git-0b78a1b22a4461b1909b0716d1572d2119d1c450.tar.bz2
t5000: make hash independent
This test uses a stub of a very large (64 GB) object to test our generation of tar archives. In doing so, it uses the object ID of the object so it can insert it into the database properly. Look up these values using test_oid. Restructure the test slightly to use test_oid_in_path. Since we care about the object, not how it is named in a particular hash algorithm, rename it to "huge-object", which is shorter and more descriptive. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5000-tar-tree.sh')
-rwxr-xr-xt/t5000-tar-tree.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 602bfd9..37655a2 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -94,6 +94,13 @@ check_tar() {
'
}
+test_expect_success 'setup' '
+ test_oid_cache <<-EOF
+ obj sha1:19f9c8273ec45a8938e6999cb59b3ff66739902a
+ obj sha256:3c666f798798601571f5cec0adb57ce4aba8546875e7693177e0535f34d2c49b
+ EOF
+'
+
test_expect_success \
'populate workdir' \
'mkdir a &&
@@ -369,11 +376,10 @@ test_lazy_prereq TAR_HUGE '
'
test_expect_success LONG_IS_64BIT 'set up repository with huge blob' '
- obj_d=19 &&
- obj_f=f9c8273ec45a8938e6999cb59b3ff66739902a &&
- obj=${obj_d}${obj_f} &&
- mkdir -p .git/objects/$obj_d &&
- cp "$TEST_DIRECTORY"/t5000/$obj .git/objects/$obj_d/$obj_f &&
+ obj=$(test_oid obj) &&
+ path=$(test_oid_to_path $obj) &&
+ mkdir -p .git/objects/$(dirname $path) &&
+ cp "$TEST_DIRECTORY"/t5000/huge-object .git/objects/$path &&
rm -f .git/index &&
git update-index --add --cacheinfo 100644,$obj,huge &&
git commit -m huge