1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

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
This commit is contained in:
Jesse Duffield
2023-07-28 18:53:00 +10:00
parent 4c5b1574f1
commit 06be88aef7
9 changed files with 27 additions and 45 deletions

View File

@ -21,11 +21,11 @@ type Worktree struct {
Branch string
// based on the path, but uniquified. Not the same name that git uses in the worktrees/ folder (no good reason for this,
// I just prefer my naming convention better)
NameField string
Name string
}
func (w *Worktree) RefName() string {
return w.Name()
return w.Name
}
func (w *Worktree) ID() string {
@ -35,19 +35,3 @@ func (w *Worktree) ID() string {
func (w *Worktree) Description() string {
return w.RefName()
}
func (w *Worktree) Name() string {
return w.NameField
}
func (w *Worktree) Main() bool {
return w.IsMain
}
func (w *Worktree) Current() bool {
return w.IsCurrent
}
func (w *Worktree) PathMissing() bool {
return w.IsPathMissing
}