Subject: [PATCH 0/2] merge-ours: sparse-index integration

From: "Sam Bostock via GitGitGadget" <[email-masked]>
Date: Fri, 06 Feb 2026 02:32:02 +0000

This short series teaches merge-ours to work with a sparse index.

Patch 1 is a preparatory cleanup that converts merge-ours away from
the_repository global, using the repo parameter instead.

Patch 2 adds the actual sparse-index integration and tests. Because
merge-ours is invoked as a subprocess by git merge -s ours and never
previously read config, the sparse-checkout globals remained unset, causing
the index to be expanded unconditionally. A repo_config() call fixes this.

Developed with AI assistance (Claude).

Sam Bostock (2):
  merge-ours: drop USE_THE_REPOSITORY_VARIABLE
  merge-ours: integrate with sparse-index

 builtin/merge-ours.c                     | 15 +++++++++------
 t/t1092-sparse-checkout-compatibility.sh | 14 ++++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)

base-commit: b2826b52eb7caff9f4ed6e85ec45e338bf02ad09
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2189%2Fsambostock%2Fsb%2Fmerge-ours-sparse-index-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2189/sambostock/sb/merge-ours-sparse-index-v1
Pull-Request: https://github.com/git/git/pull/2189
-- 
gitgitgadget