Thread (7 messages) 7 messages, 3 authors, 9d ago

Re: [PATCH v1] repository: move fetch_if_missing into struct repository

From: Junio C Hamano <hidden>
Date: 2026-07-15 03:27:27

Tian Yuchen [off-list ref] writes:
quoted hunk ↗ jump to hunk
The global variable 'fetch_if_missing' controls whether a missing
object check should prompt a lazy fetch from a promisor remote.
In order to continue the libification effort, move it into
'struct repository' and initialize it to 1 by default to keep the
previous behavior.
...
diff --git a/setup.c b/setup.c
index b4652651df..ce2a80ac31 100644
--- a/setup.c
+++ b/setup.c
@@ -1064,7 +1064,7 @@ static void setup_git_env_internal(struct repository *repo,
 		set_alternate_shallow_file(repo, shallow_file, 0);
 
 	if (git_env_bool(NO_LAZY_FETCH_ENVIRONMENT, 0))
-		fetch_if_missing = 0;
+		the_repository->fetch_if_missing = 0;
 }
Could a caller pass a "repo" that is not the_repository?  In other
words, shouldn't this be

		repo->fetch_if_missing = 0;

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