{"thread":{"id":"66733","subject":"[Outreachy PATCH] wt-status: use the repository the status already has","startedAt":"2026-11-01T06:39:51Z","lastAt":"2026-11-01T06:39:51Z","messageCount":1,"participants":["Okhuomon Ajayi"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"557055","messageId":"20261101063951.85427-1-okhuomonajayi54@gmail.com","threadId":"66733","inReplyTo":null,"subject":"[Outreachy PATCH] wt-status: use the repository the status already has","fromName":"Okhuomon Ajayi","fromEmail":"okhuomonajayi54@gmail.com","sentAt":"2026-11-01T06:39:51Z","receivedAt":"2026-11-01T06:39:51Z","isPatch":true,"sender":{"key":"okhuomonajayi54@gmail.com","avatar":null},"body":"wt_longstatus_print_verbose() sets up the work tree of the_repository,\neven though its wt_status already names the repository in s->repo.\nwt_status_check_sparse_checkout() receives a repository, but reads\nthe sparse-checkout setting from the_repository.\n\nUse s->repo and r instead.\n\nKeep USE_THE_REPOSITORY_VARIABLE because DEFAULT_ABBREV, which is\nstill used in this file, expands to the global default_abbrev.\n\nSigned-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>\n---\n wt-status.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 238bb48643..5bd1ecee10 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1208,7 +1208,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s)\n \t\tstatus_printf_ln(s, c,\n \t\t\t\"--------------------------------------------------\");\n \t\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n-\t\tsetup_work_tree(the_repository);\n+\t\tsetup_work_tree(s->repo);\n \t\trev.diffopt.a_prefix = \"i/\";\n \t\trev.diffopt.b_prefix = \"w/\";\n \t\trun_diff_files(&rev, 0);\n@@ -1895,7 +1895,7 @@ static void wt_status_check_sparse_checkout(struct repository *r,\n {\n \tint skip_worktree = 0;\n \tint i;\n-\tstruct repo_config_values *cfg = repo_config_values(the_repository);\n+\tstruct repo_config_values *cfg = repo_config_values(r);\n \n \tif (!cfg->apply_sparse_checkout ||\n \t    r->index->cache_nr == 0) {\n\nbase-commit: 50fe5cc63f9cd6e89b87a2c9ccf96a444f4cfdb7\n-- \n2.56.0\n\n\n"}]}