[PATCH 4/5] merge-ort: prevent the_repository from coming back
- From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Feb 18, 2026, 09:15 UTC
- Message-ID
- <46c24e0d05a91f830e400914a7e446afab320859.1771406115.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2048.git.1771406115.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
There are two things preventing us from removing our usage of USE_THE_REPOSITORY_VARIABLE: one necessary use of the_repository in prefetch_for_content_merges(), and the use of DEFAULT_ABBREV. We have removed all other uses of the_repository in merge-ort before (multiple times), but without removing that definition, they keep coming back.
Define the_repository to make it a compilation error so that they don't come back any more, with a special carve-out for prefetch_for_content_merges().
Signed-off-by: Elijah Newren <newren@gmail.com> --- merge-ort.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/merge-ort.c b/merge-ort.c index 40a11dca73..ae19118550 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -53,6 +53,8 @@ #include "unpack-trees.h" #include "xdiff-interface.h" +#define the_repository DO_NOT_USE_THE_REPOSITORY + /* * We have many arrays of size 3. Whenever we have such an array, the * indices refer to one of the sides of the three-way merge. This is so @@ -4433,6 +4435,8 @@ static int process_entry(struct merge_options *opt, return 0; } +#undef the_repository + static void prefetch_for_content_merges(struct merge_options *opt, struct string_list *plist) { @@ -4481,6 +4485,8 @@ static void prefetch_for_content_merges(struct merge_options *opt, oid_array_clear(&to_fetch); } +#define the_repository DO_NOT_USE_the_repository + static int process_entries(struct merge_options *opt, struct object_id *result_oid) {
-- gitgitgadget