diff options
| author | Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> | 2026-02-18 23:23:41 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-19 08:59:24 -0800 |
| commit | 9d0d2ba217f3ceefb0315b556f012edb598b9724 (patch) | |
| tree | 62b788dcf53e6f1f4de8d02906be59f17bf59f95 /range-diff.c | |
| parent | 4631e22f925fa2af8d8548af97ee2215be101409 (diff) | |
| download | git-9d0d2ba217f3ceefb0315b556f012edb598b9724.tar.xz | |
wt-status: replace uses of the_repository with local repository instances
wt-status.c uses the global the_repository in several places even when a
repository instance is already available via struct wt_status *s or struct
repository *r.
Replace these uses of the_repository with the repository available in the
local context (i.e. s->repo or r).
The replacements of all the_repository with s->repo are mostly to cases
where a repository instance is already available via struct wt_status *s
and struct repository *r, all functions operating on struct wt_status *s
are only used after s is initialized by wt_status_prepare(), which sets
s->repo from the repository provided by the caller. As a result, s->repo is
guaranteed to be available and consistent whenever these functions are
invoked.
This reduces reliance on global state and keeps wt-status consistent,
though many functions operating on struct wt_status *s are called via
commit.c and it still relies on the_repository, but within wt-status.c the
local repository pointer refers to the same underlying repository object.
Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
0 files changed, 0 insertions, 0 deletions
