setup: rename ref storage format environment variables
With the same reasoning as for git-init(1), rename the environment variables GIT_REFERENCE_BACKEND and GIT_DEFAULT_REF_FORMAT to GIT_REF_STORAGE_FORMAT and GIT_DEFAULT_REF_STORAGE_FORMAT, respectively. The old names are kept as an alias to retain compatibility. While at it, fix indentation for `GIT_REF_STORAGE_FORMAT` docs to use tabs instead of spaces. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>next
parent
78c0b35650
commit
768ec52864
|
|
@ -16,7 +16,7 @@ endif::[]
|
|||
`init.defaultRefFormat`::
|
||||
Allows overriding the default ref storage format for new repositories.
|
||||
See `--ref-storage-format=` in linkgit:git-init[1]. Both the command line
|
||||
option and the `GIT_DEFAULT_REF_FORMAT` environment variable take
|
||||
option and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take
|
||||
precedence over this config.
|
||||
|
||||
init.defaultSubmodulePathConfig::
|
||||
|
|
|
|||
|
|
@ -590,15 +590,21 @@ double-quotes and respecting backslash escapes. E.g., the value
|
|||
is always used. The default is "sha1".
|
||||
See `--object-format` in linkgit:git-init[1].
|
||||
|
||||
`GIT_DEFAULT_REF_FORMAT`::
|
||||
If this variable is set, the default reference backend format for new
|
||||
`GIT_DEFAULT_REF_STORAGE_FORMAT`::
|
||||
If this variable is set, the default ref storage format for new
|
||||
repositories will be set to this value. The default is "files".
|
||||
See `--ref-storage-format` in linkgit:git-init[1].
|
||||
|
||||
`GIT_DEFAULT_REF_FORMAT`::
|
||||
Deprecated alias of `GIT_DEFAULT_REF_STORAGE_FORMAT`.
|
||||
|
||||
`GIT_REF_STORAGE_FORMAT`::
|
||||
Specify which ref storage format to use along with its URI.
|
||||
See `extensions.refStorage` option in linkgit:git-config[1] for more
|
||||
details. Overrides the config variable when used.
|
||||
|
||||
`GIT_REFERENCE_BACKEND`::
|
||||
Specify which reference backend to be used along with its URI.
|
||||
See `extensions.refStorage` option in linkgit:git-config[1] for more
|
||||
details. Overrides the config variable when used.
|
||||
Deprecated alias of `GIT_REF_STORAGE_FORMAT`.
|
||||
|
||||
Git Commits
|
||||
~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT "GIT_TEXTDOMAINDIR"
|
||||
#define GIT_ATTR_SOURCE_ENVIRONMENT "GIT_ATTR_SOURCE"
|
||||
#define GIT_REFERENCE_BACKEND_ENVIRONMENT "GIT_REFERENCE_BACKEND"
|
||||
#define GIT_REF_STORAGE_FORMAT_ENVIRONMENT "GIT_REF_STORAGE_FORMAT"
|
||||
|
||||
/*
|
||||
* Environment variable used to propagate the --no-advice global option to the
|
||||
|
|
|
|||
28
setup.c
28
setup.c
|
|
@ -2049,7 +2049,9 @@ const char *setup_git_directory_gently(struct repository *repo, int *nongit_ok)
|
|||
* The env variable should override the repository config
|
||||
* for 'extensions.refStorage'.
|
||||
*/
|
||||
ref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);
|
||||
ref_backend_uri = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT);
|
||||
if (!ref_backend_uri)
|
||||
ref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);
|
||||
if (ref_backend_uri) {
|
||||
FREE_AND_NULL(discovery.format.ref_storage_payload);
|
||||
discovery.format.ref_storage_format =
|
||||
|
|
@ -2769,22 +2771,31 @@ static void repository_format_configure(struct repository_format *repo_fmt,
|
|||
* --ref-storage-format=`.
|
||||
*
|
||||
* 2. Explicit override via the environment with
|
||||
* GIT_REFERENCE_BACKEND.
|
||||
* "GIT_REF_STORAGE_FORMAT".
|
||||
*
|
||||
* 3. Existing repository format. All the subsequent sources only
|
||||
* 3. Its deprecated equivalent "GIT_REFERENCE_BACKEND".
|
||||
*
|
||||
* 4. Existing repository format. All the subsequent sources only
|
||||
* kick in when there is no repository yet.
|
||||
*
|
||||
* 4. The default ref storage format for new repositories as
|
||||
* configured via "GIT_DEFAULT_REF_FORMAT".
|
||||
* configured via "GIT_DEFAULT_REF_STORAGE_FORMAT".
|
||||
*
|
||||
* 5. The default ref storage format for new repositories as
|
||||
* 5. Its deprecated equivalent "GIT_DEFAULT_REF_FORMAT".
|
||||
*
|
||||
* 6. The default ref storage format for new repositories as
|
||||
* configured via "init.defaultRefFormat"
|
||||
*
|
||||
* 6. Otherwise, we fall back to the default ref storage format
|
||||
* 7. Otherwise, we fall back to the default ref storage format
|
||||
* compiled into Git.
|
||||
*/
|
||||
if (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {
|
||||
/* nothing to do */
|
||||
} else if ((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT))) {
|
||||
ref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);
|
||||
if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
|
||||
die(_("unknown ref storage format specified via %s: '%s'"),
|
||||
GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env);
|
||||
} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {
|
||||
ref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);
|
||||
if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
|
||||
|
|
@ -2793,6 +2804,11 @@ static void repository_format_configure(struct repository_format *repo_fmt,
|
|||
} else if (repo_fmt->version >= 0) {
|
||||
ref_storage_format = repo_fmt->ref_storage_format;
|
||||
ref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);
|
||||
} else if ((env = getenv("GIT_DEFAULT_REF_STORAGE_FORMAT"))) {
|
||||
ref_storage_format = ref_storage_format_by_name(env);
|
||||
if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
|
||||
die(_("unknown ref storage format specified via %s: '%s'"),
|
||||
"GIT_DEFAULT_REF_STORAGE_FORMAT", env);
|
||||
} else if ((env = getenv("GIT_DEFAULT_REF_FORMAT"))) {
|
||||
ref_storage_format = ref_storage_format_by_name(env);
|
||||
if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
|
||||
|
|
|
|||
|
|
@ -640,22 +640,22 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with unknown back
|
|||
test_grep "invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}garbage${SQ}" err
|
||||
'
|
||||
|
||||
test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '
|
||||
test_expect_success 'init with GIT_DEFAULT_REF_STORAGE_FORMAT=garbage' '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
cat >expect <<-EOF &&
|
||||
fatal: unknown ref storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}
|
||||
fatal: unknown ref storage format specified via GIT_DEFAULT_REF_STORAGE_FORMAT: ${SQ}garbage${SQ}
|
||||
EOF
|
||||
test_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&
|
||||
test_must_fail env GIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init refformat 2>err &&
|
||||
test_cmp expect err
|
||||
'
|
||||
|
||||
test_expect_success 'GIT_REFERENCE_BACKEND refuses to reinitialize with different storage format' '
|
||||
test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with different storage format' '
|
||||
test_when_finished "rm -rf refbackend" &&
|
||||
git init --ref-storage-format=files refbackend &&
|
||||
cat >expect <<-EOF &&
|
||||
fatal: attempt to reinitialize repository with different reference storage format
|
||||
EOF
|
||||
test_must_fail env GIT_REFERENCE_BACKEND=reftable git init refbackend 2>err &&
|
||||
test_must_fail env GIT_REF_STORAGE_FORMAT=reftable git init refbackend 2>err &&
|
||||
test_cmp expect err
|
||||
'
|
||||
|
||||
|
|
@ -668,14 +668,14 @@ test_expect_success 'init warns about invalid init.defaultRefFormat' '
|
|||
test_cmp expect err &&
|
||||
|
||||
git -C repo rev-parse --show-ref-storage-format >actual &&
|
||||
echo $GIT_DEFAULT_REF_FORMAT >expected &&
|
||||
echo $GIT_DEFAULT_REF_STORAGE_FORMAT >expected &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success 'default ref format' '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
(
|
||||
sane_unset GIT_DEFAULT_REF_FORMAT &&
|
||||
sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&
|
||||
git init refformat
|
||||
) &&
|
||||
git version --build-options | sed -ne "s/^default-ref-storage-format: //p" >expect &&
|
||||
|
|
@ -686,9 +686,9 @@ test_expect_success 'default ref format' '
|
|||
backends="files reftable"
|
||||
for format in $backends
|
||||
do
|
||||
test_expect_success DEFAULT_REPO_FORMAT "init with GIT_DEFAULT_REF_FORMAT=$format" '
|
||||
test_expect_success DEFAULT_REPO_FORMAT "init with GIT_DEFAULT_REF_STORAGE_FORMAT=$format" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
GIT_DEFAULT_REF_FORMAT=$format git init refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&
|
||||
|
||||
if test $format = files
|
||||
then
|
||||
|
|
@ -718,7 +718,7 @@ do
|
|||
test_when_finished "rm -rf refformat" &&
|
||||
test_config_global init.defaultRefFormat $format &&
|
||||
(
|
||||
sane_unset GIT_DEFAULT_REF_FORMAT &&
|
||||
sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&
|
||||
git init refformat
|
||||
) &&
|
||||
|
||||
|
|
@ -727,37 +727,37 @@ do
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success "--ref-storage-format=$format overrides GIT_DEFAULT_REF_FORMAT" '
|
||||
test_expect_success "--ref-storage-format=$format overrides GIT_DEFAULT_REF_STORAGE_FORMAT" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
GIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init --ref-storage-format=$format refformat &&
|
||||
echo $format >expect &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success "reinit repository with GIT_DEFAULT_REF_FORMAT=$format does not change format" '
|
||||
test_expect_success "reinit repository with GIT_DEFAULT_REF_STORAGE_FORMAT=$format does not change format" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
git init refformat &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >expect &&
|
||||
GIT_DEFAULT_REF_FORMAT=$format git init refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
done
|
||||
|
||||
test_expect_success "--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT" '
|
||||
test_expect_success "--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOMAT" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
GIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=files git init --ref-storage-format=reftable refformat &&
|
||||
echo reftable >expect &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success "GIT_DEFAULT_REF_FORMAT= overrides init.defaultRefFormat" '
|
||||
test_expect_success "GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
test_config_global init.defaultRefFormat files &&
|
||||
|
||||
GIT_DEFAULT_REF_FORMAT=reftable git init refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=reftable git init refformat &&
|
||||
echo reftable >expect &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
|
|
@ -767,7 +767,7 @@ test_expect_success "init with feature.experimental=true" '
|
|||
test_when_finished "rm -rf refformat" &&
|
||||
test_config_global feature.experimental true &&
|
||||
(
|
||||
sane_unset GIT_DEFAULT_REF_FORMAT &&
|
||||
sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&
|
||||
git init refformat
|
||||
) &&
|
||||
echo reftable >expect &&
|
||||
|
|
@ -780,7 +780,7 @@ test_expect_success "init.defaultRefFormat overrides feature.experimental=true"
|
|||
test_config_global feature.experimental true &&
|
||||
test_config_global init.defaultRefFormat files &&
|
||||
(
|
||||
sane_unset GIT_DEFAULT_REF_FORMAT &&
|
||||
sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&
|
||||
git init refformat
|
||||
) &&
|
||||
echo files >expect &&
|
||||
|
|
@ -788,10 +788,10 @@ test_expect_success "init.defaultRefFormat overrides feature.experimental=true"
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success "GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true" '
|
||||
test_expect_success "GIT_DEFAULT_REF_STORAGE_FORMAT= overrides feature.experimental=true" '
|
||||
test_when_finished "rm -rf refformat" &&
|
||||
test_config_global feature.experimental true &&
|
||||
GIT_DEFAULT_REF_FORMAT=files git init refformat &&
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT=files git init refformat &&
|
||||
echo files >expect &&
|
||||
git -C refformat rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
|
|
@ -942,7 +942,7 @@ test_expect_success 'branch -m with the initial branch' '
|
|||
test_expect_success 'init with includeIf.onbranch condition' '
|
||||
test_when_finished "rm -rf repo" &&
|
||||
git -c includeIf.onbranch:main.path=nonexistent init repo &&
|
||||
echo $GIT_DEFAULT_REF_FORMAT >expect &&
|
||||
echo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&
|
||||
git -C repo rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
|
@ -951,7 +951,7 @@ test_expect_success 'init with includeIf.onbranch condition with existing direct
|
|||
test_when_finished "rm -rf repo" &&
|
||||
mkdir repo &&
|
||||
git -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&
|
||||
echo $GIT_DEFAULT_REF_FORMAT >expect &&
|
||||
echo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&
|
||||
git -C repo rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
|
@ -960,7 +960,7 @@ test_expect_success 're-init with includeIf.onbranch condition' '
|
|||
test_when_finished "rm -rf repo" &&
|
||||
git init repo &&
|
||||
git -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&
|
||||
echo $GIT_DEFAULT_REF_FORMAT >expect &&
|
||||
echo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&
|
||||
git -C repo rev-parse --show-ref-storage-format >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ assert_jumps () {
|
|||
local nr="$1"
|
||||
local trace="$2"
|
||||
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
grep -q "name:jumps_made value:$nr$" $trace;;
|
||||
reftable)
|
||||
grep -q "name:reseeks_made value:$nr$" $trace;;
|
||||
*)
|
||||
BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
|
||||
BUG "unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT";;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
@ -93,13 +93,13 @@ test_expect_success 'adjacent, non-overlapping excluded regions' '
|
|||
for_each_ref refs/heads/foo refs/heads/quux >expect &&
|
||||
|
||||
test_cmp expect actual &&
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
assert_jumps 1 perf;;
|
||||
reftable)
|
||||
assert_jumps 2 perf;;
|
||||
*)
|
||||
BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
|
||||
BUG "unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT";;
|
||||
esac
|
||||
'
|
||||
|
||||
|
|
@ -125,13 +125,13 @@ test_expect_success 'several overlapping excluded regions' '
|
|||
for_each_ref refs/heads/quux >expect &&
|
||||
|
||||
test_cmp expect actual &&
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
assert_jumps 1 perf;;
|
||||
reftable)
|
||||
assert_jumps 3 perf;;
|
||||
*)
|
||||
BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
|
||||
BUG "unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT";;
|
||||
esac
|
||||
'
|
||||
|
||||
|
|
@ -141,13 +141,13 @@ test_expect_success 'unordered excludes' '
|
|||
for_each_ref refs/heads/bar refs/heads/quux >expect &&
|
||||
|
||||
test_cmp expect actual &&
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
assert_jumps 1 perf;;
|
||||
reftable)
|
||||
assert_jumps 2 perf;;
|
||||
*)
|
||||
BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
|
||||
BUG "unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT";;
|
||||
esac
|
||||
'
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ test_description='Test reference backend URIs'
|
|||
# <uri> is the new URI to be set for the ref storage.
|
||||
# <cmd> is the git subcommand to be run in the repository.
|
||||
# <via> if 'config', set the backend via the 'extensions.refStorage' config.
|
||||
# if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.
|
||||
# if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.
|
||||
run_with_uri () {
|
||||
repo=$1 &&
|
||||
backend=$2 &&
|
||||
|
|
@ -23,7 +23,7 @@ run_with_uri () {
|
|||
git -C "$repo" config set core.repositoryformatversion 1 &&
|
||||
if test "$via" = "env"
|
||||
then
|
||||
test_env GIT_REFERENCE_BACKEND="$uri" git -C "$repo" $cmd
|
||||
test_env GIT_REF_STORAGE_FORMAT="$uri" git -C "$repo" $cmd
|
||||
elif test "$via" = "config"
|
||||
then
|
||||
git -C "$repo" config set extensions.refStorage "$uri" &&
|
||||
|
|
@ -40,7 +40,7 @@ run_with_uri () {
|
|||
# <backend> is the original ref storage of the repo.
|
||||
# <uri> is the new URI to be set for the ref storage.
|
||||
# <via> if 'config', set the backend via the 'extensions.refStorage' config.
|
||||
# if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.
|
||||
# if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.
|
||||
# <err_msg> (optional) if set, check if 'git-refs(1)' failed with the provided msg.
|
||||
test_refs_backend () {
|
||||
repo=$1 &&
|
||||
|
|
@ -54,7 +54,7 @@ test_refs_backend () {
|
|||
then
|
||||
if test "$via" = "env"
|
||||
then
|
||||
test_env GIT_REFERENCE_BACKEND="$uri" test_must_fail git -C "$repo" refs list 2>err
|
||||
test_env GIT_REF_STORAGE_FORMAT="$uri" test_must_fail git -C "$repo" refs list 2>err
|
||||
elif test "$via" = "config"
|
||||
then
|
||||
git -C "$repo" config set extensions.refStorage "$uri" &&
|
||||
|
|
@ -83,7 +83,7 @@ verify_files_exist () {
|
|||
test_cmp expect $gitdir/HEAD
|
||||
|
||||
# verify that backend specific files exist.
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
test_path_is_dir $refdir/refs/heads &&
|
||||
test_path_is_file $refdir/HEAD;;
|
||||
|
|
@ -91,7 +91,7 @@ verify_files_exist () {
|
|||
test_path_is_dir $refdir/reftable &&
|
||||
test_path_is_file $refdir/reftable/tables.list;;
|
||||
*)
|
||||
BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
|
||||
BUG "unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT";;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ do
|
|||
test_expect_success "migrating repository to $to_format with alternate refs directory" '
|
||||
test_when_finished "rm -rf repo refdir" &&
|
||||
mkdir refdir &&
|
||||
GIT_REFERENCE_BACKEND="${from_format}://$(pwd)/refdir" git init repo &&
|
||||
GIT_REF_STORAGE_FORMAT="${from_format}://$(pwd)/refdir" git init repo &&
|
||||
(
|
||||
cd repo &&
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ test_expect_success 'initializing repository with alt ref directory' '
|
|||
test_when_finished "rm -rf repo refdir" &&
|
||||
mkdir refdir &&
|
||||
BACKEND="$(test_detect_ref_format)://$(pwd)/refdir" &&
|
||||
GIT_REFERENCE_BACKEND=$BACKEND git init repo &&
|
||||
GIT_REF_STORAGE_FORMAT=$BACKEND git init repo &&
|
||||
verify_files_exist repo/.git refdir &&
|
||||
(
|
||||
cd repo &&
|
||||
|
|
@ -264,7 +264,7 @@ test_expect_success 'cloning repository with alt ref directory' '
|
|||
test_commit -C source 3 &&
|
||||
|
||||
BACKEND="$(test_detect_ref_format)://$(pwd)/refdir" &&
|
||||
GIT_REFERENCE_BACKEND=$BACKEND git clone source repo &&
|
||||
GIT_REF_STORAGE_FORMAT=$BACKEND git clone source repo &&
|
||||
|
||||
git -C repo config get extensions.refstorage >actual &&
|
||||
echo $BACKEND >expect &&
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ test_ref_format () {
|
|||
|
||||
for OTHER_FORMAT in files reftable
|
||||
do
|
||||
if test "$OTHER_FORMAT" = "$GIT_DEFAULT_REF_FORMAT"
|
||||
if test "$OTHER_FORMAT" = "$GIT_DEFAULT_REF_STORAGE_FORMAT"
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
|
@ -43,7 +43,7 @@ test_expect_success 'add submodules with different ref storage format' '
|
|||
git init submodule &&
|
||||
test_commit -C submodule submodule-initial &&
|
||||
git init upstream &&
|
||||
test_ref_format upstream "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format upstream "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
git -C upstream submodule add --ref-storage-format="$OTHER_FORMAT" "file://$(pwd)/submodule" &&
|
||||
test_ref_format upstream/submodule "$OTHER_FORMAT"
|
||||
'
|
||||
|
|
@ -59,8 +59,8 @@ test_expect_success 'recursive clone propagates ref storage format' '
|
|||
|
||||
# The upstream repository and its submodule should be using the default
|
||||
# ref format.
|
||||
test_ref_format upstream "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format upstream/submodule "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format upstream "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
test_ref_format upstream/submodule "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
|
||||
# The cloned repositories should use the other ref format that we have
|
||||
# specified via `--ref-storage-format`. The option should propagate to cloned
|
||||
|
|
@ -81,7 +81,7 @@ test_expect_success 'clone submodules with different ref storage format' '
|
|||
git -C upstream commit -m "upstream submodule" &&
|
||||
|
||||
git clone --no-recurse-submodules "file://$(pwd)/upstream" downstream &&
|
||||
test_ref_format downstream "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format downstream "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
git -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&
|
||||
test_ref_format downstream/submodule "$OTHER_FORMAT"
|
||||
'
|
||||
|
|
@ -98,7 +98,7 @@ test_expect_success 'status with mixed submodule ref storages' '
|
|||
|
||||
# The main repository should use the default ref format now, whereas
|
||||
# the submodule should use the other format.
|
||||
test_ref_format main "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format main "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
test_ref_format main/submodule "$OTHER_FORMAT" &&
|
||||
|
||||
cat >expect <<-EOF &&
|
||||
|
|
@ -123,7 +123,7 @@ test_expect_success 'recursive pull with mixed formats' '
|
|||
# submodules have different formats.
|
||||
git clone --no-recurse-submodules "file://$(pwd)/upstream" downstream &&
|
||||
git -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&
|
||||
test_ref_format downstream "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
test_ref_format downstream "$GIT_DEFAULT_REF_STORAGE_FORMAT" &&
|
||||
test_ref_format downstream/submodule "$OTHER_FORMAT" &&
|
||||
|
||||
# Update the upstream submodule as well as the owning repository such
|
||||
|
|
|
|||
|
|
@ -575,8 +575,8 @@ export EDITOR
|
|||
GIT_TEST_BUILTIN_HASH=$("$GIT_BINARY" version --build-options | sed -ne 's/^default-hash: //p')
|
||||
GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}"
|
||||
export GIT_DEFAULT_HASH
|
||||
GIT_DEFAULT_REF_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
|
||||
export GIT_DEFAULT_REF_FORMAT
|
||||
GIT_DEFAULT_REF_STORAGE_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
|
||||
export GIT_DEFAULT_REF_STORAGE_FORMAT
|
||||
|
||||
# Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output
|
||||
GIT_TRACE_BARE=1
|
||||
|
|
@ -1752,13 +1752,13 @@ parisc* | hppa*)
|
|||
;;
|
||||
esac
|
||||
|
||||
case "$GIT_DEFAULT_REF_FORMAT" in
|
||||
case "$GIT_DEFAULT_REF_STORAGE_FORMAT" in
|
||||
files)
|
||||
test_set_prereq REFFILES;;
|
||||
reftable)
|
||||
test_set_prereq REFTABLE;;
|
||||
*)
|
||||
echo 2>&1 "error: unknown ref format $GIT_DEFAULT_REF_FORMAT"
|
||||
echo 2>&1 "error: unknown ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Reference in New Issue