зеркало из https://github.com/microsoft/git.git
submodule-config: remove support for overlaying repository config
All callers have been migrated to explicitly read any configuration they need. The support for handling it automatically in submodule-config is no longer needed. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
078b75e99b
Коммит
32bc548329
|
@ -34,7 +34,6 @@ extern int option_fetch_parse_recurse_submodules(const struct option *opt,
|
||||||
const char *arg, int unset);
|
const char *arg, int unset);
|
||||||
extern int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
|
extern int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
|
||||||
extern int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
|
extern int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
|
||||||
extern int parse_submodule_config_option(const char *var, const char *value);
|
|
||||||
extern int submodule_config_option(struct repository *repo,
|
extern int submodule_config_option(struct repository *repo,
|
||||||
const char *var, const char *value);
|
const char *var, const char *value);
|
||||||
extern const struct submodule *submodule_from_name(
|
extern const struct submodule *submodule_from_name(
|
||||||
|
|
|
@ -10,11 +10,6 @@ static void die_usage(int argc, const char **argv, const char *msg)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int git_test_config(const char *var, const char *value, void *cb)
|
|
||||||
{
|
|
||||||
return parse_submodule_config_option(var, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int cmd_main(int argc, const char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char **arg = argv;
|
const char **arg = argv;
|
||||||
|
@ -38,7 +33,6 @@ int cmd_main(int argc, const char **argv)
|
||||||
|
|
||||||
setup_git_directory();
|
setup_git_directory();
|
||||||
gitmodules_config();
|
gitmodules_config();
|
||||||
git_config(git_test_config, NULL);
|
|
||||||
|
|
||||||
while (*arg) {
|
while (*arg) {
|
||||||
struct object_id commit_oid;
|
struct object_id commit_oid;
|
||||||
|
|
|
@ -122,78 +122,6 @@ test_expect_success 'using different treeishs works' '
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >super/expect_url <<EOF
|
|
||||||
Submodule url: 'git@somewhere.else.net:a.git' for path 'b'
|
|
||||||
Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat >super/expect_local_path <<EOF
|
|
||||||
Submodule name: 'a' for path 'c'
|
|
||||||
Submodule name: 'submodule' for path 'submodule'
|
|
||||||
EOF
|
|
||||||
|
|
||||||
test_expect_success 'reading of local configuration' '
|
|
||||||
(cd super &&
|
|
||||||
old_a=$(git config submodule.a.url) &&
|
|
||||||
old_submodule=$(git config submodule.submodule.url) &&
|
|
||||||
git config submodule.a.url git@somewhere.else.net:a.git &&
|
|
||||||
git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
|
|
||||||
test-submodule-config --url \
|
|
||||||
"" b \
|
|
||||||
"" submodule \
|
|
||||||
>actual &&
|
|
||||||
test_cmp expect_url actual &&
|
|
||||||
git config submodule.a.path c &&
|
|
||||||
test-submodule-config \
|
|
||||||
"" c \
|
|
||||||
"" submodule \
|
|
||||||
>actual &&
|
|
||||||
test_cmp expect_local_path actual &&
|
|
||||||
git config submodule.a.url "$old_a" &&
|
|
||||||
git config submodule.submodule.url "$old_submodule" &&
|
|
||||||
git config --unset submodule.a.path c
|
|
||||||
)
|
|
||||||
'
|
|
||||||
|
|
||||||
cat >super/expect_url <<EOF
|
|
||||||
Submodule url: '../submodule' for path 'b'
|
|
||||||
Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
|
|
||||||
EOF
|
|
||||||
|
|
||||||
test_expect_success 'reading of local configuration for uninitialized submodules' '
|
|
||||||
(
|
|
||||||
cd super &&
|
|
||||||
git submodule deinit -f b &&
|
|
||||||
old_submodule=$(git config submodule.submodule.url) &&
|
|
||||||
git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
|
|
||||||
test-submodule-config --url \
|
|
||||||
"" b \
|
|
||||||
"" submodule \
|
|
||||||
>actual &&
|
|
||||||
test_cmp expect_url actual &&
|
|
||||||
git config submodule.submodule.url "$old_submodule" &&
|
|
||||||
git submodule init b
|
|
||||||
)
|
|
||||||
'
|
|
||||||
|
|
||||||
cat >super/expect_fetchrecurse_die.err <<EOF
|
|
||||||
fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
|
|
||||||
EOF
|
|
||||||
|
|
||||||
test_expect_success 'local error in fetchrecursesubmodule dies early' '
|
|
||||||
(cd super &&
|
|
||||||
git config submodule.submodule.fetchrecursesubmodules blabla &&
|
|
||||||
test_must_fail test-submodule-config \
|
|
||||||
"" b \
|
|
||||||
"" submodule \
|
|
||||||
>actual.out 2>actual.err &&
|
|
||||||
touch expect_fetchrecurse_die.out &&
|
|
||||||
test_cmp expect_fetchrecurse_die.out actual.out &&
|
|
||||||
test_cmp expect_fetchrecurse_die.err actual.err &&
|
|
||||||
git config --unset submodule.submodule.fetchrecursesubmodules
|
|
||||||
)
|
|
||||||
'
|
|
||||||
|
|
||||||
test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
|
test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
|
||||||
(cd super &&
|
(cd super &&
|
||||||
git config -f .gitmodules \
|
git config -f .gitmodules \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче