Thread (61 messages) 61 messages, 6 authors, 2021-09-27

Re: [PATCH v2 7/8] submodule-config: pass repo upon blob config read

flat view

From: Jonathan Tan <hidden>
Date: 2021-08-16 20:57:18

quoted
quoted
@@ -1827,7 +1829,7 @@ static int git_config_from_blob_ref(config_fn_t fn,

        if (get_oid(name, &oid) < 0)
This should be `repo_get_oid(repo, ...)` now.
Ah, good catch! This wasn't caught by the tests because the submodule
config mechanism always passes a full-length hexadecimal string hash as
"name" - and probably would never be caught because
git_config_from_blob_ref() is only called from config_with_options(),
which is called with non-NULL source from only 2 files:
submodule-config.c (this one) and builtin/config.c (which most likely
will never operate on any repo other than the_repository). I'll refactor
the API to avoid this situation in the first place.
The refactoring I was thinking of was parsing the OID in
builtin/config.c and then passing only the OID (instead of a
user-provided string that could contain anything), but that doesn't
really work because the user-provided string is used in certain outputs.
I'll just change it to repo_get_oid() in this patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help