Merge branch 'bc/sha-256-part-3'
The final leg of SHA-256 transition. * bc/sha-256-part-3: (39 commits) t: remove test_oid_init in tests docs: add documentation for extensions.objectFormat ci: run tests with SHA-256 t: make SHA1 prerequisite depend on default hash t: allow testing different hash algorithms via environment t: add test_oid option to select hash algorithm repository: enable SHA-256 support by default setup: add support for reading extensions.objectformat bundle: add new version for use with SHA-256 builtin/verify-pack: implement an --object-format option http-fetch: set up git directory before parsing pack hashes t0410: mark test with SHA1 prerequisite t5308: make test work with SHA-256 t9700: make hash size independent t9500: ensure that algorithm info is preserved in config t9350: make hash size independent t9301: make hash size independent t9300: use $ZERO_OID instead of hard-coded object ID t9300: abstract away SHA-1-specific constants t8011: make hash size independent ...
This commit is contained in:
@ -1464,9 +1464,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
|
||||
@ -1515,7 +1513,17 @@ test_oid_cache () {
|
||||
# Look up a per-hash value based on a key ($1). The value must have been loaded
|
||||
# by test_oid_init or test_oid_cache.
|
||||
test_oid () {
|
||||
local var="test_oid_${test_hash_algo}_$1" &&
|
||||
local algo="${test_hash_algo}" &&
|
||||
|
||||
case "$1" in
|
||||
--hash=*)
|
||||
algo="${1#--hash=}" &&
|
||||
shift;;
|
||||
*)
|
||||
;;
|
||||
esac &&
|
||||
|
||||
local var="test_oid_${algo}_$1" &&
|
||||
|
||||
# If the variable is unset, we must be missing an entry for this
|
||||
# key-hash pair, so exit with an error.
|
||||
|
||||
Reference in New Issue
Block a user