Thread (59 messages) 59 messages, 5 authors, 2021-06-19

Re: [PATCH 1/4] promisor-remote: read partialClone config here

flat view

From: Taylor Blau <hidden>
Date: 2021-06-04 19:58:09

On Tue, Jun 01, 2021 at 02:34:16PM -0700, Jonathan Tan wrote:
quoted hunk ↗ jump to hunk
@@ -99,6 +94,11 @@ static int promisor_remote_config(const char *var, const char *value, void *data
 	size_t namelen;
 	const char *subkey;

+	if (!strcmp(var, "extensions.partialclone")) {
+		repository_format_partial_clone = xstrdup(value);
Can value ever be NULL here? I think the answer is "no, because we check
earlier in setup.c:handle_extension_v0()", but there is an implicit
conversion from xstrdup_or_null() to just xstrdup(), which would fault
if value were to be NULL.

Looking deeper, this path is a little confusing to me, since (in the
pre-image), handle_extension_v0() makes a copy of value and binds it to
data->partial_clone. But then check_repository_format_gently() makes
another copy of canidate->partial_clone (which is the same location as
data->partial_clone).

So, the extra copy is a little strange to me, because even though the
copy in handle_extension_v0() is definitely necessary, I'm not certain
that the one in set_repository_format_partial_clone() is. And this patch
removes the latter one, which I think is good. But we never free
repository_format_partial_clone.

Maybe that is added in a later patch, let's see...

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help