Jesse Duffield
06be88aef7
Use fields rather than methods on worktrees
...
I would prefer to use methods to keep things immutable but I'd rather be consistent with the other
models and update them all at once
2023-07-30 18:35:24 +10:00
Jesse Duffield
4c5b1574f1
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.
2023-07-30 18:35:24 +10:00
Jesse Duffield
de57cfd6ff
Remove IO logic from presentation code for worktrees
...
We're doing all the IO in our workers loader method so that we don't need to do any
in our presentation code
2023-07-30 18:35:24 +10:00
Jesse Duffield
2b24c15938
Add test for opening lazygit in the worktree of a bare repo
2023-07-30 18:35:23 +10:00
Jesse Duffield
a313b16704
Add more worktree tests
2023-07-30 18:35:23 +10:00
Jesse Duffield
277142fc4b
Add worktree integration tests
2023-07-30 18:35:23 +10:00
Jesse Duffield
81a9133261
Support older versions of git when fetching worktrees
...
Older versions of git don't support the -z flag in `git worktree list`.
So we're using newlines.
Also, we're not raising an error upon error because that triggers another refresh,
which gets us into an infinite loop
2023-07-30 18:35:23 +10:00
Jesse Duffield
b73efb2c22
Better logic for knowing which repo we're in
2023-07-30 18:35:22 +10:00
Jesse Duffield
ec839e9e96
Associate branches with worktrees even when mid-rebase
2023-07-30 18:35:22 +10:00
Jesse Duffield
53f4ccb809
Move current worktree to top of list
2023-07-30 18:35:22 +10:00
Jesse Duffield
c713d550c0
Improve name handling
2023-07-30 18:35:22 +10:00
Jesse Duffield
7682ec029b
Update worktree model
2023-07-30 18:35:22 +10:00
Joel Baranick
54708233ac
Improve worktree panel
2023-07-30 18:35:21 +10:00
Joel Baranick
c679fd1924
Style missing worktree as red and display better error when trying to switch to them
...
Use a broken link icon for missing worktrees
2023-07-30 18:35:21 +10:00
Joel Baranick
9a79154d05
Hide worktrees in the worktree panel if they point at a non-existing filesystem location.
...
Remove unneeded check when filtering out branches from non-current worktrees from the branch panel.
Add link icon for linked worktrees
2023-07-30 18:35:21 +10:00
Joel Baranick
f8ba899b87
Initial addition of support for worktrees
2023-07-30 18:35:21 +10:00