Merge branch 'sb/submodule-fetchjobs-default-to-one'
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2019 21:49:52 +0000 (13:49 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2019 21:49:52 +0000 (13:49 -0800)
"git submodule update" ought to use a single job unless asked, but
by mistake used multiple jobs, which has been fixed.

* sb/submodule-fetchjobs-default-to-one:
submodule update: run at most one fetch job unless otherwise set

1  2 
builtin/submodule--helper.c
index b45514be317eafb765a8943241b5d880f65e3117,1f8a4a9d522f6ecc906dd0902167264c097bbffc..0c5b2eb5fc6bb7553b71dac5f16d04e312093ae0
@@@ -1265,20 -1265,19 +1265,20 @@@ struct submodule_alternate_setup 
        SUBMODULE_ALTERNATE_ERROR_IGNORE, NULL }
  
  static int add_possible_reference_from_superproject(
 -              struct alternate_object_database *alt, void *sas_cb)
 +              struct object_directory *odb, void *sas_cb)
  {
        struct submodule_alternate_setup *sas = sas_cb;
 +      size_t len;
  
        /*
         * If the alternate object store is another repository, try the
         * standard layout with .git/(modules/<name>)+/objects
         */
 -      if (ends_with(alt->path, "/objects")) {
 +      if (strip_suffix(odb->path, "/objects", &len)) {
                char *sm_alternate;
                struct strbuf sb = STRBUF_INIT;
                struct strbuf err = STRBUF_INIT;
 -              strbuf_add(&sb, alt->path, strlen(alt->path) - strlen("objects"));
 +              strbuf_add(&sb, odb->path, len);
  
                /*
                 * We need to end the new path with '/' to mark it as a dir,
                 * as the last part of a missing submodule reference would
                 * be taken as a file name.
                 */
 -              strbuf_addf(&sb, "modules/%s/", sas->submodule_name);
 +              strbuf_addf(&sb, "/modules/%s/", sas->submodule_name);
  
                sm_alternate = compute_alternate_path(sb.buf, &err);
                if (sm_alternate) {
@@@ -1552,7 -1551,7 +1552,7 @@@ struct submodule_update_clone 
  #define SUBMODULE_UPDATE_CLONE_INIT {0, MODULE_LIST_INIT, 0, \
        SUBMODULE_UPDATE_STRATEGY_INIT, 0, 0, -1, STRING_LIST_INIT_DUP, 0, \
        NULL, NULL, NULL, \
-       NULL, 0, 0, 0, NULL, 0, 0, 0}
+       NULL, 0, 0, 0, NULL, 0, 0, 1}
  
  
  static void next_submodule_warn_missing(struct submodule_update_clone *suc,