1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-22 05:29:44 +02:00
lazygit/pkg/commands/models/worktree.go

33 lines
442 B
Go
Raw Normal View History

package models
import (
"path/filepath"
)
// Worktree : A git worktree
type Worktree struct {
2022-09-02 20:08:36 -07:00
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
}