]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib.sh
Merge branch 'js/cmake-vs'
[thirdparty/git.git] / t / test-lib.sh
index ba224c86f5e9988a7294c30260d9ef7590681e25..ef31f400374755015ccec300bdb450021aeccc17 100644 (file)
@@ -455,6 +455,9 @@ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
 export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
 export EDITOR
 
+GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-sha1}"
+export GIT_DEFAULT_HASH
+
 # Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output
 GIT_TRACE_BARE=1
 export GIT_TRACE_BARE
@@ -1689,7 +1692,11 @@ test_lazy_prereq CURL '
 # which will not work with other hash algorithms and tests that work but don't
 # test anything meaningful (e.g. special values which cause short collisions).
 test_lazy_prereq SHA1 '
-       test $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
+       case "$GIT_DEFAULT_HASH" in
+       sha1) true ;;
+       "") test $(git hash-object /dev/null) = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 ;;
+       *) false ;;
+       esac
 '
 
 test_lazy_prereq REBASE_P '