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

[Outreachy PATCH] diffcore-rename: stop using the_repository

From
OAOkhuomon Ajayi <okhuomonajayi54@gmail.com>
Date
Oct 24, 2026, 22:13 UTC
Message-ID
<20261024221341.92086-1-okhuomonajayi54@gmail.com>

diffcore_rename_extended() already has the repository through options. Use its hash algorithm when checking for empty blobs, and pass it to start_delayed_progress().

Remove the USE_THE_REPOSITORY_VARIABLE definition.
Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
 diffcore-rename.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/diffcore-rename.c b/diffcore-rename.c
index c797d8ed2f..f0ce6e14e5 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -3,8 +3,6 @@
  * Copyright (C) 2005 Junio C Hamano
  */
 
-#define USE_THE_REPOSITORY_VARIABLE
-
 #include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
@@ -1424,7 +1422,8 @@ void diffcore_rename_extended(struct diff_options *options,
 				 strcmp(options->single_follow, p->two->path))
 				continue; /* not interested */
 			else if (!options->flags.rename_empty &&
-				 is_empty_blob_oid(&p->two->oid, the_repository->hash_algo))
+				 is_empty_blob_oid(&p->two->oid,
+						   options->repo->hash_algo))
 				continue;
 			else if (add_rename_dst(p) < 0) {
 				warning("skipping rename detection, detected"
@@ -1434,7 +1433,8 @@ void diffcore_rename_extended(struct diff_options *options,
 			}
 		}
 		else if (!options->flags.rename_empty &&
-			 is_empty_blob_oid(&p->one->oid, the_repository->hash_algo))
+			 is_empty_blob_oid(&p->one->oid,
+					   options->repo->hash_algo))
 			continue;
 		else if (!DIFF_PAIR_UNMERGED(p) && !DIFF_FILE_VALID(p->two)) {
 			/*
@@ -1567,7 +1567,7 @@ void diffcore_rename_extended(struct diff_options *options,
 	trace2_region_enter("diff", "inexact renames", options->repo);
 	if (options->show_rename_progress) {
 		progress = start_delayed_progress(
-				the_repository,
+				options->repo,
 				_("Performing inexact rename detection"),
 				(uint64_t)num_destinations * (uint64_t)num_sources);
 	}

base-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e
-- 
2.56.0
Next: Patrick Steinhardt
Message 1 of 5 in “diffcore-rename: stop using the_repository”
  1. diffcore-rename: stop using the_repositoryOkhuomon Ajayi, Oct 24, 2026
  2. Patrick SteinhardtOct 26, 2026
  3. Okhuomon AjayiOct 26, 2026
  4. Patrick SteinhardtOct 26, 2026
  5. Okhuomon AjayiOct 26, 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.