t: introduce GIT_TEST_DEFAULT_REF_FORMAT envvar
Introduce a new GIT_TEST_DEFAULT_REF_FORMAT environment variable that lets developers run the test suite with a different default ref format without impacting the ref format used by non-test Git invocations. This is modeled after GIT_TEST_DEFAULT_OBJECT_FORMAT, which does the same thing for the repository's object format. Adapt the setup of the `REFFILES` test prerequisite to be conditionally set based on the default ref format. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
aa19619a98
commit
58aaf59133
3
t/README
3
t/README
@ -479,6 +479,9 @@ GIT_TEST_DEFAULT_HASH=<hash-algo> specifies which hash algorithm to
|
||||
use in the test scripts. Recognized values for <hash-algo> are "sha1"
|
||||
and "sha256".
|
||||
|
||||
GIT_TEST_DEFAULT_REF_FORMAT=<format> specifies which ref storage format
|
||||
to use in the test scripts. Recognized values for <format> are "files".
|
||||
|
||||
GIT_TEST_NO_WRITE_REV_INDEX=<boolean>, when true disables the
|
||||
'pack.writeReverseIndex' setting.
|
||||
|
||||
|
@ -1659,6 +1659,11 @@ test_detect_hash () {
|
||||
test_hash_algo="${GIT_TEST_DEFAULT_HASH:-sha1}"
|
||||
}
|
||||
|
||||
# Detect the hash algorithm in use.
|
||||
test_detect_ref_format () {
|
||||
echo "${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
|
||||
}
|
||||
|
||||
# Load common hash metadata and common placeholder object IDs for use with
|
||||
# test_oid.
|
||||
test_oid_init () {
|
||||
|
@ -542,6 +542,8 @@ export EDITOR
|
||||
|
||||
GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-sha1}"
|
||||
export GIT_DEFAULT_HASH
|
||||
GIT_DEFAULT_REF_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
|
||||
export GIT_DEFAULT_REF_FORMAT
|
||||
GIT_TEST_MERGE_ALGORITHM="${GIT_TEST_MERGE_ALGORITHM:-ort}"
|
||||
export GIT_TEST_MERGE_ALGORITHM
|
||||
|
||||
@ -1745,7 +1747,14 @@ parisc* | hppa*)
|
||||
;;
|
||||
esac
|
||||
|
||||
test_set_prereq REFFILES
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
files)
|
||||
test_set_prereq REFFILES;;
|
||||
*)
|
||||
echo 2>&1 "error: unknown ref format $GIT_DEFAULT_REF_FORMAT"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
|
||||
test -z "$NO_CURL" && test_set_prereq LIBCURL
|
||||
|
Reference in New Issue
Block a user