Centralise logic for obtaining repo paths

There are quite a few paths you might want to get e.g. the repo's path, the worktree's path,
the repo's git dir path, the worktree's git dir path. I want these all obtained once and
then used when needed rather than having to have IO whenever we need them. This is not so
much about reducing time spent on IO as it is about not having to care about errors every time
we want a path.
This commit is contained in:
Jesse Duffield 2023-07-28 18:27:14 +10:00
parent de57cfd6ff
commit 4c5b1574f1
22 changed files with 347 additions and 250 deletions

View file

@ -631,7 +631,7 @@ func (self *RefreshHelper) refreshStatus() {
workingTreeState := self.c.Git().Status.WorkingTreeState()
linkedWorktreeName := self.worktreeHelper.GetLinkedWorktreeName()
repoName := git_commands.GetCurrentRepoName()
repoName := self.c.Git().RepoPaths.RepoName()
status := presentation.FormatStatus(repoName, currentBranch, linkedWorktreeName, workingTreeState, self.c.Tr)