builtin/clone: rename "--ref-format=" to "--ref-storage-format="
With the same reasoning as for git-init(1), rename "--ref-format=" to "--ref-storage-format=" and keep the old name as an alias. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
1 parent
9e7865bd14
commit
9bba3ad909
7 files changed
+21
-17
No files matched your search
@@ -348,12 +348,15 @@ or `--mirror` is given)
|
||||
The result is Git repository can be separated from working
|
||||
tree.
|
||||
|
||||
`--ref-format=<ref-format>`::
|
||||
`--ref-storage-format=<format>`::
|
||||
|
||||
Specify the given ref storage format for the repository. The valid values are:
|
||||
+
|
||||
include::ref-storage-format.adoc[]
|
||||
|
||||
`--ref-format=<format>`::
|
||||
Deprecated alias of `--ref-storage-format=<format>`.
|
||||
|
||||
`-j<n>`::
|
||||
`--jobs=<n>`::
|
||||
The number of submodules fetched at the same time.
|
||||
|
||||
+7
-6
@@ -901,7 +901,7 @@ int cmd_clone(int argc,
|
||||
char *option_origin = NULL;
|
||||
struct string_list option_not = STRING_LIST_INIT_NODUP;
|
||||
const char *real_git_dir = NULL;
|
||||
const char *ref_format = NULL;
|
||||
const char *ref_storage_format_str = NULL;
|
||||
const char *option_upload_pack = "git-upload-pack";
|
||||
int option_progress = -1;
|
||||
int option_sparse_checkout = 0;
|
||||
@@ -981,8 +981,9 @@ int cmd_clone(int argc,
|
||||
N_("any cloned submodules will be shallow")),
|
||||
OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"),
|
||||
N_("separate git dir from working tree")),
|
||||
OPT_STRING(0, "ref-format", &ref_format, N_("format"),
|
||||
N_("specify the reference format to use")),
|
||||
OPT_STRING(0, "ref-storage-format", &ref_storage_format_str, N_("format"),
|
||||
N_("specify the reference storage format to use")),
|
||||
OPT_ALIAS_F(0, "ref-format", "ref-storage-format", PARSE_OPT_HIDDEN),
|
||||
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),
|
||||
N_("set config inside the new repository")),
|
||||
OPT_STRING_LIST(0, "server-option", &server_options,
|
||||
@@ -1027,10 +1028,10 @@ int cmd_clone(int argc,
|
||||
if (option_single_branch == -1)
|
||||
option_single_branch = deepen ? 1 : 0;
|
||||
|
||||
if (ref_format) {
|
||||
ref_storage_format = ref_storage_format_by_name(ref_format);
|
||||
if (ref_storage_format_str) {
|
||||
ref_storage_format = ref_storage_format_by_name(ref_storage_format_str);
|
||||
if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
|
||||
die(_("unknown ref storage format '%s'"), ref_format);
|
||||
die(_("unknown ref storage format '%s'"), ref_storage_format_str);
|
||||
}
|
||||
|
||||
if (option_mirror) {
|
||||
|
||||
@@ -165,7 +165,7 @@ test_expect_success 'clone: can clone reffiles into reftable repository' '
|
||||
test_when_finished "rm -rf reffiles reftable" &&
|
||||
git init --ref-storage-format=files reffiles &&
|
||||
test_commit -C reffiles A &&
|
||||
git clone --ref-format=reftable ./reffiles reftable &&
|
||||
git clone --ref-storage-format=reftable ./reffiles reftable &&
|
||||
|
||||
git -C reffiles rev-parse HEAD >expect &&
|
||||
git -C reftable rev-parse HEAD >actual &&
|
||||
@@ -184,7 +184,7 @@ test_expect_success 'clone: can clone reftable into reffiles repository' '
|
||||
test_when_finished "rm -rf reffiles reftable" &&
|
||||
git init --ref-storage-format=reftable reftable &&
|
||||
test_commit -C reftable A &&
|
||||
git clone --ref-format=files ./reftable reffiles &&
|
||||
git clone --ref-storage-format=files ./reftable reffiles &&
|
||||
|
||||
git -C reftable rev-parse HEAD >expect &&
|
||||
git -C reffiles rev-parse HEAD >actual &&
|
||||
|
||||
@@ -143,7 +143,7 @@ do
|
||||
test_when_finished "rm -rf repo repo.git" &&
|
||||
git init --ref-storage-format=$from_format repo &&
|
||||
test_commit -C repo initial &&
|
||||
git clone --ref-format=$from_format --mirror repo repo.git &&
|
||||
git clone --ref-storage-format=$from_format --mirror repo repo.git &&
|
||||
test_migration repo.git "$to_format"
|
||||
'
|
||||
|
||||
|
||||
+3
-3
@@ -46,19 +46,19 @@ test_expect_success "clone and setup child repos" '
|
||||
) &&
|
||||
git clone . bundle &&
|
||||
git clone . seven &&
|
||||
git clone --ref-format=reftable . case_sensitive &&
|
||||
git clone --ref-storage-format=reftable . case_sensitive &&
|
||||
(
|
||||
cd case_sensitive &&
|
||||
git branch branch1 &&
|
||||
git branch bRanch1
|
||||
) &&
|
||||
git clone --ref-format=reftable . case_sensitive_fd &&
|
||||
git clone --ref-storage-format=reftable . case_sensitive_fd &&
|
||||
(
|
||||
cd case_sensitive_fd &&
|
||||
git branch foo/bar &&
|
||||
git branch Foo
|
||||
) &&
|
||||
git clone --ref-format=reftable . case_sensitive_df &&
|
||||
git clone --ref-storage-format=reftable . case_sensitive_df &&
|
||||
(
|
||||
cd case_sensitive_df &&
|
||||
git branch Foo/bar &&
|
||||
|
||||
+2
-2
@@ -166,7 +166,7 @@ test_expect_success 'clone --mirror does not repeat tags' '
|
||||
|
||||
test_expect_success 'clone with files ref format' '
|
||||
test_when_finished "rm -rf ref-storage" &&
|
||||
git clone --ref-format=files --mirror src ref-storage &&
|
||||
git clone --ref-storage-format=files --mirror src ref-storage &&
|
||||
echo files >expect &&
|
||||
git -C ref-storage rev-parse --show-ref-format >actual &&
|
||||
test_cmp expect actual
|
||||
@@ -176,7 +176,7 @@ test_expect_success 'clone with garbage ref format' '
|
||||
cat >expect <<-EOF &&
|
||||
fatal: unknown ref storage format ${SQ}garbage${SQ}
|
||||
EOF
|
||||
test_must_fail git clone --ref-format=garbage --mirror src ref-storage 2>err &&
|
||||
test_must_fail git clone --ref-storage-format=garbage --mirror src ref-storage 2>err &&
|
||||
test_cmp expect err &&
|
||||
test_path_is_missing ref-storage
|
||||
'
|
||||
|
||||
@@ -63,9 +63,9 @@ test_expect_success 'recursive clone propagates ref storage format' '
|
||||
test_ref_format upstream/submodule "$GIT_DEFAULT_REF_FORMAT" &&
|
||||
|
||||
# The cloned repositories should use the other ref format that we have
|
||||
# specified via `--ref-format`. The option should propagate to cloned
|
||||
# specified via `--ref-storage-format`. The option should propagate to cloned
|
||||
# submodules.
|
||||
git clone --ref-format=$OTHER_FORMAT --recurse-submodules \
|
||||
git clone --ref-storage-format=$OTHER_FORMAT --recurse-submodules \
|
||||
upstream downstream &&
|
||||
test_ref_format downstream "$OTHER_FORMAT" &&
|
||||
test_ref_format downstream/submodule "$OTHER_FORMAT"
|
||||
|
||||
Reference in new issue
Block a user