Subject: Re: [Outreachy PATCH v2 2/3] environment: environment: stop using core.sparseCheckout globally

From: Junio C Hamano <[email-masked]>
Date: Tue, 13 Jan 2026 11:38:20 -0800

Olamide Caleb Bello <[email-masked]> writes:

> diff --git a/builtin/backfill.c b/builtin/backfill.c
> index e80fc1b694..90d5312240 100644
> --- a/builtin/backfill.c
> +++ b/builtin/backfill.c
> @@ -1,4 +1,3 @@
> -/* We need this macro to access core_apply_sparse_checkout */

Why this removal?  You'll need to be able to access the_repository
because ...

>  #define USE_THE_REPOSITORY_VARIABLE
>  
>  #include "builtin.h"
> @@ -139,7 +138,7 @@ int cmd_backfill(int argc, const char **argv, const char *prefix, struct reposit
>  	repo_config(repo, git_default_config, NULL);
>  
>  	if (ctx.sparse < 0)
> -		ctx.sparse = core_apply_sparse_checkout;
> +		ctx.sparse = repo->config_values.sparse_checkout;
>  
>  	result = do_backfill(&ctx);
>  	backfill_context_clear(&ctx);
> diff --git a/builtin/clone.c b/builtin/clone.c
> index b19b302b06..b6b19e83d1 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -623,7 +623,7 @@ static int git_sparse_checkout_init(const char *repo)
>  	 * We must apply the setting in the current process
>  	 * for the later checkout to use the sparse-checkout file.
>  	 */
> -	core_apply_sparse_checkout = 1;
> +	the_repository->config_values.sparse_checkout = 1;

... you'd need to access this, even if it is now called slightly
differently, no?