diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-09-12 13:29:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-12 19:15:39 +0200 |
commit | 1dc4ec2102971ee5d19331a8ccf09939272bc6ca (patch) | |
tree | 3e99eab7d74de2d6bd07417fdedc74229fd9f76c /wt-status.c | |
parent | environment: make `get_object_directory()` accept a repository (diff) | |
download | git-1dc4ec2102971ee5d19331a8ccf09939272bc6ca.tar.xz git-1dc4ec2102971ee5d19331a8ccf09939272bc6ca.zip |
environment: make `get_index_file()` accept a repository
The `get_index_file()` function retrieves the path to the index file
of `the_repository`. Make it accept a `struct repository` such that it
can work on arbitrary repositories and make it part of the repository
subsystem. This reduces our reliance on `the_repository` and clarifies
scope.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | wt-status.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c index b477239039..b813d3fe1c 100644 --- a/wt-status.c +++ b/wt-status.c @@ -16,6 +16,7 @@ #include "revision.h" #include "diffcore.h" #include "quote.h" +#include "repository.h" #include "run-command.h" #include "strvec.h" #include "remote.h" @@ -152,7 +153,7 @@ void wt_status_prepare(struct repository *r, struct wt_status *s) "HEAD", 0, NULL, NULL); s->reference = "HEAD"; s->fp = stdout; - s->index_file = get_index_file(); + s->index_file = repo_get_index_file(the_repository); s->change.strdup_strings = 1; s->untracked.strdup_strings = 1; s->ignored.strdup_strings = 1; |