1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/commands/models/stash_entry.go

31 lines
505 B
Go
Raw Normal View History

2020-09-29 10:46:45 +02:00
package models
import "fmt"
// StashEntry : A git stash entry
type StashEntry struct {
2023-12-20 21:51:39 +02:00
Index int
Recency string
Name string
}
2022-05-12 12:16:58 +02:00
func (s *StashEntry) FullRefName() string {
return s.RefName()
}
func (s *StashEntry) RefName() string {
return fmt.Sprintf("stash@{%d}", s.Index)
}
2022-03-26 15:18:08 +02:00
func (s *StashEntry) ParentRefName() string {
return s.RefName() + "^"
}
func (s *StashEntry) ID() string {
return s.RefName()
}
func (s *StashEntry) Description() string {
return s.RefName() + ": " + s.Name
}