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

[PATCH] TO-SQUASH: replace the_repository with arbitrary r

From
Derrick Stolee <dstolee@microsoft.com>
Date
Jul 18, 2018, 13:40 UTC
Message-ID
<20180718134026.243823-1-dstolee@microsoft.com>
In-Reply-To
<20180717224935.96397-3-sbeller@google.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
This should just be squashed into PATCH 2.
 builtin/replace.c | 5 ++---
 replace-object.c  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 5f34659071..d0b1cdb061 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -57,9 +57,8 @@ static int show_reference(struct repository *r, const char *refname,
 			if (get_oid(refname, &object))
 				return error("Failed to resolve '%s' as a valid ref.", refname);
 
-			obj_type = oid_object_info(the_repository, &object,
-						   NULL);
-			repl_type = oid_object_info(the_repository, oid, NULL);
+			obj_type = oid_object_info(r, &object, NULL);
+			repl_type = oid_object_info(r, oid, NULL);
 
 			printf("%s (%s) -> %s (%s)\n", refname, type_name(obj_type),
 			       oid_to_hex(oid), type_name(repl_type));
diff --git a/replace-object.c b/replace-object.c
index 01a5a59a35..017f02f8ef 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -26,7 +26,7 @@ static int register_replace_ref(struct repository *r,
 	oidcpy(&repl_obj->replacement, oid);
 
 	/* Register new object */
-	if (oidmap_put(the_repository->objects->replace_map, repl_obj))
+	if (oidmap_put(r->objects->replace_map, repl_obj))
 		die("duplicate replace ref: %s", refname);
 
 	return 0;
-- 
2.18.0.118.gd4f65b8d14
Previous: Stefan Beller
Message 6 of 6 in “RFC ref store to repository migration”
  1. 0/2 RFC ref store to repository migrationStefan Beller, Jul 17, 2018
  2. 1/2 refs.c: migrate internal ref iteration to pass thru repository argumentStefan Beller, Jul 17, 2018
  3. 2/2 refs.c: upgrade for_each_replace_ref to be a each_repo_ref_fn callbackStefan Beller, Jul 17, 2018
  4. Derrick StoleeJul 18, 2018
  5. Stefan BellerJul 18, 2018
  6. TO-SQUASH: replace the_repository with arbitrary rDerrick Stolee, Jul 18, 2018

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.