Merge branch 'jt/grep-wo-submodule-odb-as-alternate'

The code to make "git grep" recurse into submodules has been
updated to migrate away from the "add submodule's object store as
an alternate object store" mechanism (which is suboptimal).

* jt/grep-wo-submodule-odb-as-alternate:
  t7814: show lack of alternate ODB-adding
  submodule-config: pass repo upon blob config read
  grep: add repository to OID grep sources
  grep: allocate subrepos on heap
  grep: read submodule entry with explicit repo
  grep: typesafe versions of grep_source_init
  grep: use submodule-ODB-as-alternate lazy-addition
  submodule: lazily add submodule ODBs as alternates
This commit is contained in:
Junio C Hamano
2021-09-20 15:20:39 -07:00
11 changed files with 161 additions and 55 deletions

View File

@ -32,6 +32,7 @@
#include "packfile.h"
#include "object-store.h"
#include "promisor-remote.h"
#include "submodule.h"
/* The maximum size for an object header. */
#define MAX_HEADER_LEN 32
@ -1613,6 +1614,10 @@ static int do_oid_object_info_extended(struct repository *r,
break;
}
if (register_all_submodule_odb_as_alternates())
/* We added some alternates; retry */
continue;
/* Check if it is a missing object */
if (fetch_if_missing && repo_has_promisor_remote(r) &&
!already_retried &&