Git development
 help / color / mirror / Atom feed
From: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
To: git@vger.kernel.org
Cc: christian.couder@gmail.com, usmanakinyemi202@gmail.com,
	siddharthasthana31@gmail.com, kaartic.sivaraam@gmail.com,
	Okhuomon Ajayi <okhuomonajayi54@gmail.com>
Subject: [Outreachy PATCH] diffcore-rename: stop using the_repository
Date: Sat, 24 Oct 2026 23:13:41 +0100	[thread overview]
Message-ID: <20261024221341.92086-1-okhuomonajayi54@gmail.com> (raw)

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


             reply	other threads:[~2026-10-24 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 22:13 Okhuomon Ajayi [this message]
2026-10-26 10:52 ` [Outreachy PATCH] diffcore-rename: stop using the_repository Patrick Steinhardt
2026-10-26 11:22   ` Okhuomon Ajayi
2026-10-26 11:54     ` Patrick Steinhardt
2026-10-26 11:58       ` Okhuomon Ajayi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261024221341.92086-1-okhuomonajayi54@gmail.com \
    --to=okhuomonajayi54@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=siddharthasthana31@gmail.com \
    --cc=usmanakinyemi202@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox