summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-08-16 21:09:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-08 18:48:09 (GMT)
commite3e8bf046e9682b0d67c07c6bc83ec9717d9c941 (patch)
tree4f7add2b871f29541679ac0d55b6f10cb4756af4 /config.h
parent0693806bf82fb76347e226d8fc5e69077c0a3df5 (diff)
downloadgit-e3e8bf046e9682b0d67c07c6bc83ec9717d9c941.zip
git-e3e8bf046e9682b0d67c07c6bc83ec9717d9c941.tar.gz
git-e3e8bf046e9682b0d67c07c6bc83ec9717d9c941.tar.bz2
submodule-config: pass repo upon blob config read
When reading the config of a submodule, if reading from a blob, read using an explicitly specified repository instead of by adding the submodule's ODB as an alternate and then reading an object from the_repository. This makes the "grep --recurse-submodules with submodules without .gitmodules in the working tree" test in t7814 work when GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB is true. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r--config.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.h b/config.h
index a2200f3..147f5e0 100644
--- a/config.h
+++ b/config.h
@@ -49,6 +49,8 @@ const char *config_scope_name(enum config_scope scope);
struct git_config_source {
unsigned int use_stdin:1;
const char *file;
+ /* The repository if blob is not NULL; leave blank for the_repository */
+ struct repository *repo;
const char *blob;
enum config_scope scope;
};
@@ -136,6 +138,7 @@ int git_config_from_mem(config_fn_t fn,
const char *buf, size_t len,
void *data, const struct config_options *opts);
int git_config_from_blob_oid(config_fn_t fn, const char *name,
+ struct repository *repo,
const struct object_id *oid, void *data);
void git_config_push_parameter(const char *text);
void git_config_push_env(const char *spec);