diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-13 11:13:37 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-13 10:01:01 -0700 |
| commit | a973f60dc7c178828e351ec4e68886ffecfbcadc (patch) | |
| tree | 1dc78a861d10f3df03ffee3ea0210be5985fd36d /builtin/fsck.c | |
| parent | 78f2210b3c8605144d62a90b58e888312f64efc8 (diff) | |
| download | git-a973f60dc7c178828e351ec4e68886ffecfbcadc.tar.gz | |
path: stop relying on `the_repository` in `worktree_git_path()`
When not provided a worktree, then `worktree_git_path()` will fall back
to returning a path relative to the main repository. In this case, we
implicitly rely on `the_repository` to derive the path. Remove this
dependency by passing a `struct repository` as parameter.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fsck.c')
| -rw-r--r-- | builtin/fsck.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index d13a226c2e..ad36df9628 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -1050,7 +1050,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) * and may get overwritten by other calls * while we're examining the index. */ - path = xstrdup(worktree_git_path(wt, "index")); + path = xstrdup(worktree_git_path(the_repository, wt, "index")); read_index_from(&istate, path, get_worktree_git_dir(wt)); fsck_index(&istate, path, wt->is_current); discard_index(&istate); |
