# [Outreachy PATCH] diffcore-rename: stop using the_repository

5 messages from 2026-10-24 to 2026-10-26. Participants: Okhuomon Ajayi, Patrick Steinhardt.
Thread: https://gitlist.dev/t/66656

## Okhuomon Ajayi, 2026-10-24 22:13

Subject: [Outreachy PATCH] diffcore-rename: stop using the_repository
Message-ID: <20261024221341.92086-1-okhuomonajayi54@gmail.com>
URL: https://gitlist.dev/e/20261024221341.92086-1-okhuomonajayi54%40gmail.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



```

## Patrick Steinhardt, 2026-10-26 10:52

Subject: Re: [Outreachy PATCH] diffcore-rename: stop using the_repository
Message-ID: <at8w9u6qA1dhmw3r@pks.im>
URL: https://gitlist.dev/e/at8w9u6qA1dhmw3r%40pks.im
In-Reply-To: <20261024221341.92086-1-okhuomonajayi54@gmail.com>

```
On Sat, Oct 24, 2026 at 11:13:41PM +0100, Okhuomon Ajayi wrote:
> 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.

All of the conversions are trivial, and we already dereference
`options->repo` unconditionally in this function. So the patch looks
trivially correct to me, nice!

Patrick


```

## Okhuomon Ajayi, 2026-10-26 11:22

Subject: Re: [Outreachy PATCH] diffcore-rename: stop using the_repository
Message-ID: <CAFpMFfDaVf47QKkNROJAHJB7oJR+iPt5gkkCnj4KdZW_9MRqGQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFpMFfDaVf47QKkNROJAHJB7oJR%2BiPt5gkkCnj4KdZW_9MRqGQ%40mail.gmail.com
In-Reply-To: <at8w9u6qA1dhmw3r@pks.im>

```
Thanks for the review, Patrick!

On Mon, Oct 26, 2026 at 11:52 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> On Sat, Oct 24, 2026 at 11:13:41PM +0100, Okhuomon Ajayi wrote:
> > 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.
>
> All of the conversions are trivial, and we already dereference
> `options->repo` unconditionally in this function. So the patch looks
> trivially correct to me, nice!
>
> Patrick


```

## Patrick Steinhardt, 2026-10-26 11:54

Subject: Re: [Outreachy PATCH] diffcore-rename: stop using the_repository
Message-ID: <at8_ebX7cYMrlhU9@pks.im>
URL: https://gitlist.dev/e/at8_ebX7cYMrlhU9%40pks.im
In-Reply-To: <CAFpMFfDaVf47QKkNROJAHJB7oJR+iPt5gkkCnj4KdZW_9MRqGQ@mail.gmail.com>

```
On Mon, Oct 26, 2026 at 12:22:59PM +0100, Okhuomon Ajayi wrote:
> Thanks for the review, Patrick!

Nit: please don't top-post, the expectation is to write your answer
below the parts you respond to. Thanks!

Patrick

> On Mon, Oct 26, 2026 at 11:52 AM Patrick Steinhardt <ps@pks.im> wrote:
> >
> > On Sat, Oct 24, 2026 at 11:13:41PM +0100, Okhuomon Ajayi wrote:
> > > 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.
> >
> > All of the conversions are trivial, and we already dereference
> > `options->repo` unconditionally in this function. So the patch looks
> > trivially correct to me, nice!
> >
> > Patrick


```

## Okhuomon Ajayi, 2026-10-26 11:58

Subject: Re: [Outreachy PATCH] diffcore-rename: stop using the_repository
Message-ID: <CAFpMFfDX9QiEnO3asWMREXmE2etYuk_NvgqmfgNUzP4cYQRMDg@mail.gmail.com>
URL: https://gitlist.dev/e/CAFpMFfDX9QiEnO3asWMREXmE2etYuk_NvgqmfgNUzP4cYQRMDg%40mail.gmail.com
In-Reply-To: <at8_ebX7cYMrlhU9@pks.im>

```
> Nit: please don't top-post, the expectation is to write your answer
> below the parts you respond to. Thanks!


 My bad i am sorry i forgot ;_;


```
