diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-27 21:52:24 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 18:35:23 +1000 |
commit | 2b24c15938c5ceb29a9b2d525aa1318b8bc8a87b (patch) | |
tree | 23727dd77a11b9ec456344dc2c482cb9879c8849 /pkg/commands/git_commands/worktree_loader.go | |
parent | e874f94cf8fb8928110a0165852a8967fa823a5c (diff) |
Add test for opening lazygit in the worktree of a bare repo
Diffstat (limited to 'pkg/commands/git_commands/worktree_loader.go')
-rw-r--r-- | pkg/commands/git_commands/worktree_loader.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/worktree_loader.go b/pkg/commands/git_commands/worktree_loader.go index 6c73eaa13..bbd8367f3 100644 --- a/pkg/commands/git_commands/worktree_loader.go +++ b/pkg/commands/git_commands/worktree_loader.go @@ -46,6 +46,11 @@ func (self *WorktreeLoader) GetWorktrees() ([]*models.Worktree, error) { current = nil continue } + if splitLine == "bare" { + current = nil + continue + } + if strings.HasPrefix(splitLine, "worktree ") { path := strings.SplitN(splitLine, " ", 2)[1] isMain := path == currentRepoPath |