aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-07-01 21:22:35 +0000
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:58:26 -0700
commit9d619f2ef8c95a791d34f5d3cb2793dcc0b8610d (patch)
tree4e53ca88f262e61ada3f6c6473e4e936326a1400 /t
parentt4042: choose the built-in hash outside of a repo (diff)
downloadgit-9d619f2ef8c95a791d34f5d3cb2793dcc0b8610d.tar.gz
git-9d619f2ef8c95a791d34f5d3cb2793dcc0b8610d.zip
t5300: choose the built-in hash outside of a repo
Right now, the built-in default hash is always SHA-1, but that will change in a future commit. Instead of assuming that operating outside of a repository will always use SHA-1, look up the default hash algorithm for operating outside of a repository using an appropriate environment variable, which will always be correct. Additionally, for operations outside of a repository, use the DEFAULT_HASH_ALGORITHM prerequisite rather than SHA1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5300-pack-object.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index a5932b6a8b..5013373891 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -525,7 +525,7 @@ test_expect_success 'index-pack --strict <pack> works in non-repo' '
test_path_is_file foo.idx
'
-test_expect_success SHA1 'show-index works OK outside a repository' '
+test_expect_success DEFAULT_HASH_ALGORITHM 'show-index works OK outside a repository' '
nongit git show-index <foo.idx
'
@@ -658,7 +658,7 @@ do
test_commit -C repo initial &&
git -C repo repack -ad &&
git -C repo verify-pack "$(pwd)"/repo/.git/objects/pack/*.idx &&
- if test $hash = sha1
+ if test $hash = $GIT_TEST_BUILTIN_HASH
then
nongit git verify-pack "$(pwd)"/repo/.git/objects/pack/*.idx
else
@@ -676,7 +676,7 @@ do
test_commit -C repo initial &&
git -C repo repack -ad &&
git -C repo index-pack --verify "$(pwd)"/repo/.git/objects/pack/*.pack &&
- if test $hash = sha1
+ if test $hash = $GIT_TEST_BUILTIN_HASH
then
nongit git index-pack --verify "$(pwd)"/repo/.git/objects/pack/*.pack
else