summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands
diff options
context:
space:
mode:
authorJoel Baranick <joel.baranick@ensighten.com>2022-09-02 20:08:36 -0700
committerJesse Duffield <jessedduffield@gmail.com>2023-07-30 18:35:21 +1000
commit54708233ac595067937f09851fa58a0a326ca71f (patch)
tree5fe56384c63fa7bab11e9d60e78a94a2304aca4d /pkg/commands/git_commands
parentc679fd1924e9669a30d038fbdd164d948393c301 (diff)
Improve worktree panel
Diffstat (limited to 'pkg/commands/git_commands')
-rw-r--r--pkg/commands/git_commands/worktree_loader.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/pkg/commands/git_commands/worktree_loader.go b/pkg/commands/git_commands/worktree_loader.go
index 8dc7dcbe5..4b65caee1 100644
--- a/pkg/commands/git_commands/worktree_loader.go
+++ b/pkg/commands/git_commands/worktree_loader.go
@@ -1,6 +1,7 @@
package git_commands
import (
+ "path/filepath"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -46,18 +47,11 @@ func (self *WorktreeLoader) GetWorktrees() ([]*models.Worktree, error) {
Id: len(worktrees),
Path: path,
}
+ } else if strings.HasPrefix(splitLine, "branch ") {
+ branch := strings.SplitN(splitLine, " ", 2)[1]
+ currentWorktree.Branch = filepath.Base(branch)
}
}
- /*
- worktree /Users/jbaranick/Source/lazygit
- HEAD f6d6b5dec0432ffa953611700ab9b1ff0089f948
- branch refs/heads/worktree_support
-
- worktree /Users/jbaranick/Source/lazygit/.worktrees/worktree_tests
- HEAD f6d6b5dec0432ffa953611700ab9b1ff0089f948
- branch refs/heads/worktree_tests
- */
-
return worktrees, nil
}