git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Outreachy PATCH] bundle-uri: use the passed repository for refs and tracing

From
OAOkhuomon Ajayi <okhuomonajayi54@gmail.com>
Date
Oct 28, 2026, 09:34 UTC
Message-ID
<20261028093455.76247-1-okhuomonajayi54@gmail.com>

unbundle_from_file() receives r and unbundles the objects into it, but reads and writes the refs in the_repository. fetch_bundle_uri() also has r, but uses the_repository for its trace2 region.

Use r for both.
Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
unbundle_from_file() still depends on the_repository through
fetch_pack_fsck_objects(), which reads fetch.fsckObjects and
transfer.fsckObjects from the_repository's config. I left that out.
 bundle-uri.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/bundle-uri.c b/bundle-uri.c
index 2bb2eb99e4..0d612d92fe 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -448,9 +448,9 @@ static int unbundle_from_file(struct repository *r, const char *file)
 		strbuf_setlen(&bundle_ref, bundle_prefix_len);
 		strbuf_addstr(&bundle_ref, branch_name);
 
-		has_old = !refs_read_ref(get_main_ref_store(the_repository),
+		has_old = !refs_read_ref(get_main_ref_store(r),
 					 bundle_ref.buf, &old_oid);
-		refs_update_ref(get_main_ref_store(the_repository),
+		refs_update_ref(get_main_ref_store(r),
 				"fetched bundle", bundle_ref.buf, oid,
 				has_old ? &old_oid : NULL,
 				0, UPDATE_REFS_MSG_ON_ERR);
@@ -859,7 +859,7 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
 		.id = xstrdup(""),
 	};
 
-	trace2_region_enter("fetch", "fetch-bundle-uri", the_repository);
+	trace2_region_enter("fetch", "fetch-bundle-uri", r);
 
 	init_bundle_list(&list);
 
@@ -886,7 +886,7 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
 	for_all_bundles_in_list(&list, unlink_bundle, NULL);
 	clear_bundle_list(&list);
 	clear_remote_bundle_info(&bundle, NULL);
-	trace2_region_leave("fetch", "fetch-bundle-uri", the_repository);
+	trace2_region_leave("fetch", "fetch-bundle-uri", r);
 	return result;
 }
 

base-commit: 37b3475fb530c14109211faca33716a173db61ed
-- 
2.56.0
Next: Karthik Nayak
Message 1 of 8 in “bundle-uri: use the passed repository for refs and tracing”
  1. bundle-uri: use the passed repository for refs and tracingOkhuomon Ajayi, Oct 28, 2026
  2. Karthik NayakOct 28, 2026
  3. Okhuomon AjayiOct 28, 2026
  4. Junio C HamanoOct 28, 2026
  5. Patrick SteinhardtOct 29, 2026
  6. Okhuomon AjayiOct 29, 2026
  7. bundle-uri: stop using the_repositoryOkhuomon Ajayi, Oct 29, 2026
  8. Patrick SteinhardtOct 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.