git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Outreachy PATCH] wt-status: use the repository the status already has

From
OAOkhuomon Ajayi <okhuomonajayi54@gmail.com>
Date
Nov 1, 2026, 06:39 UTC
Message-ID
<20261101063951.85427-1-okhuomonajayi54@gmail.com>

wt_longstatus_print_verbose() sets up the work tree of the_repository, even though its wt_status already names the repository in s->repo. wt_status_check_sparse_checkout() receives a repository, but reads the sparse-checkout setting from the_repository.

Use s->repo and r instead.

Keep USE_THE_REPOSITORY_VARIABLE because DEFAULT_ABBREV, which is still used in this file, expands to the global default_abbrev.

Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
 wt-status.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 238bb48643..5bd1ecee10 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1208,7 +1208,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
 		status_printf_ln(s, c,
 			"--------------------------------------------------");
 		status_printf_ln(s, c, _("Changes not staged for commit:"));
-		setup_work_tree(the_repository);
+		setup_work_tree(s->repo);
 		rev.diffopt.a_prefix = "i/";
 		rev.diffopt.b_prefix = "w/";
 		run_diff_files(&rev, 0);
@@ -1895,7 +1895,7 @@ static void wt_status_check_sparse_checkout(struct repository *r,
 {
 	int skip_worktree = 0;
 	int i;
-	struct repo_config_values *cfg = repo_config_values(the_repository);
+	struct repo_config_values *cfg = repo_config_values(r);
 
 	if (!cfg->apply_sparse_checkout ||
 	    r->index->cache_nr == 0) {

base-commit: 50fe5cc63f9cd6e89b87a2c9ccf96a444f4cfdb7
-- 
2.56.0
Message 1 of 1 in “wt-status: use the repository the status already has”
  1. wt-status: use the repository the status already hasOkhuomon Ajayi, Nov 1, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.