Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-07-30 02:14:24 +0300
committerJunio C Hamano <gitster@pobox.com>2020-07-30 19:16:49 +0300
commit02a32dbff7e13c8cf39339e0fb6b331cab02688a (patch)
tree6668286ef00b0a3610a4fd4ddf19a6e8642bfd00 /t/test-lib-functions.sh
parentceaa4b3ad7f1927fdfa8164e1bfecece4da48329 (diff)
t: allow testing different hash algorithms via environment
To allow developers to run the testsuite with a different algorithm than the default, provide an environment variable, GIT_TEST_DEFAULT_HASH, to specify the algorithm to use. Compute the fixed constants using test_oid. Move the constant initialization down below the point where test-lib-functions.sh is loaded so the functions are defined. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 2608e80f11..2e01bb2c2b 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1417,9 +1417,7 @@ test_set_hash () {
# Detect the hash algorithm in use.
test_detect_hash () {
- # Currently we only support SHA-1, but in the future this function will
- # actually detect the algorithm in use.
- test_hash_algo='sha1'
+ test_hash_algo="${GIT_TEST_DEFAULT_HASH:-sha1}"
}
# Load common hash metadata and common placeholder object IDs for use with