1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-21 21:47:32 +02:00
lazygit/pkg/commands/models/stash_entry.go

30 lines
485 B
Go
Raw Normal View History

2020-09-29 18:46:45 +10:00
package models
import "fmt"
// StashEntry : A git stash entry
type StashEntry struct {
2020-03-27 22:53:50 +11:00
Index int
Name string
}
2022-05-12 19:16:58 +09:00
func (s *StashEntry) FullRefName() string {
return s.RefName()
}
func (s *StashEntry) RefName() string {
return fmt.Sprintf("stash@{%d}", s.Index)
}
2022-03-26 22:18:08 +09: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
}