Merge branch 'jl/maint-fetch-submodule-check-fix' into maint
* jl/maint-fetch-submodule-check-fix: fetch: skip on-demand checking when no submodules are configuredmaint
commit
8702fee617
|
@ -941,6 +941,15 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
|
||||||
argc = parse_options(argc, argv, prefix,
|
argc = parse_options(argc, argv, prefix,
|
||||||
builtin_fetch_options, builtin_fetch_usage, 0);
|
builtin_fetch_options, builtin_fetch_usage, 0);
|
||||||
|
|
||||||
|
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
|
||||||
|
if (recurse_submodules_default) {
|
||||||
|
int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
|
||||||
|
set_config_fetch_recurse_submodules(arg);
|
||||||
|
}
|
||||||
|
gitmodules_config();
|
||||||
|
git_config(submodule_config, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (all) {
|
if (all) {
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
die(_("fetch --all does not take a repository argument"));
|
die(_("fetch --all does not take a repository argument"));
|
||||||
|
@ -976,12 +985,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
|
||||||
if (!result && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {
|
if (!result && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {
|
||||||
const char *options[10];
|
const char *options[10];
|
||||||
int num_options = 0;
|
int num_options = 0;
|
||||||
if (recurse_submodules_default) {
|
|
||||||
int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
|
|
||||||
set_config_fetch_recurse_submodules(arg);
|
|
||||||
}
|
|
||||||
gitmodules_config();
|
|
||||||
git_config(submodule_config, NULL);
|
|
||||||
add_options_to_argv(&num_options, options);
|
add_options_to_argv(&num_options, options);
|
||||||
result = fetch_populated_submodules(num_options, options,
|
result = fetch_populated_submodules(num_options, options,
|
||||||
submodule_prefix,
|
submodule_prefix,
|
||||||
|
|
|
@ -373,6 +373,10 @@ void check_for_new_submodule_commits(unsigned char new_sha1[20])
|
||||||
const char *argv[] = {NULL, NULL, "--not", "--all", NULL};
|
const char *argv[] = {NULL, NULL, "--not", "--all", NULL};
|
||||||
int argc = ARRAY_SIZE(argv) - 1;
|
int argc = ARRAY_SIZE(argv) - 1;
|
||||||
|
|
||||||
|
/* No need to check if there are no submodules configured */
|
||||||
|
if (!config_name_for_path.nr)
|
||||||
|
return;
|
||||||
|
|
||||||
init_revisions(&rev, NULL);
|
init_revisions(&rev, NULL);
|
||||||
argv[1] = xstrdup(sha1_to_hex(new_sha1));
|
argv[1] = xstrdup(sha1_to_hex(new_sha1));
|
||||||
setup_revisions(argc, argv, &rev, NULL);
|
setup_revisions(argc, argv, &rev, NULL);
|
||||||
|
|
Loading…
Reference in New Issue