1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/commands/models/worktree.go
2023-07-30 18:35:21 +10:00

33 lines
442 B
Go

package models
import (
"path/filepath"
)
// Worktree : A git worktree
type Worktree struct {
Id int
Path string
Branch string
}
func (w *Worktree) RefName() string {
return w.Name()
}
func (w *Worktree) ID() string {
return w.RefName()
}
func (w *Worktree) Description() string {
return w.RefName()
}
func (w *Worktree) Name() string {
return filepath.Base(w.Path)
}
func (w *Worktree) Main() bool {
return w.Id == 0
}