diff options
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r-- | builtin/submodule--helper.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 6bf8d666ce..f6871efd95 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1,18 +1,20 @@ #define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" -#include "alloc.h" #include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h" -#include "cache.h" #include "config.h" #include "parse-options.h" #include "quote.h" +#include "path.h" #include "pathspec.h" +#include "preload-index.h" #include "dir.h" +#include "read-cache.h" #include "setup.h" +#include "sparse-index.h" #include "submodule.h" #include "submodule-config.h" #include "string-list.h" @@ -26,7 +28,7 @@ #include "diff.h" #include "object-file.h" #include "object-name.h" -#include "object-store.h" +#include "object-store-ll.h" #include "advice.h" #include "branch.h" #include "list-objects-filter-options.h" @@ -2024,14 +2026,17 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce, strbuf_reset(&sb); strbuf_addf(&sb, "submodule.%s.url", sub->name); if (repo_config_get_string_tmp(the_repository, sb.buf, &url)) { - if (starts_with_dot_slash(sub->url) || - starts_with_dot_dot_slash(sub->url)) { + if (sub->url && (starts_with_dot_slash(sub->url) || + starts_with_dot_dot_slash(sub->url))) { url = resolve_relative_url(sub->url, NULL, 0); need_free_url = 1; } else url = sub->url; } + if (!url) + die(_("cannot clone submodule '%s' without a URL"), sub->name); + strbuf_reset(&sb); strbuf_addf(&sb, "%s/.git", ce->name); needs_cloning = !file_exists(sb.buf); @@ -2189,12 +2194,13 @@ static int update_clone_task_finished(int result, } static int git_update_clone_config(const char *var, const char *value, + const struct config_context *ctx, void *cb) { int *max_jobs = cb; if (!strcmp(var, "submodule.fetchjobs")) - *max_jobs = parse_submodule_fetchjobs(var, value); + *max_jobs = parse_submodule_fetchjobs(var, value, ctx->kvi); return 0; } |