2020-09-29 18:46:45 +10:00
|
|
|
package models
|
2018-09-17 21:02:30 +10:00
|
|
|
|
2020-03-29 14:34:17 +11:00
|
|
|
import "fmt"
|
|
|
|
|
2018-09-17 21:02:30 +10:00
|
|
|
// StashEntry : A git stash entry
|
|
|
|
type StashEntry struct {
|
2020-03-27 22:53:50 +11:00
|
|
|
Index int
|
|
|
|
Name string
|
2018-09-17 21:02:30 +10:00
|
|
|
}
|
2020-03-29 14:34:17 +11:00
|
|
|
|
|
|
|
func (s *StashEntry) RefName() string {
|
|
|
|
return fmt.Sprintf("stash@{%d}", s.Index)
|
|
|
|
}
|
2020-08-22 09:01:14 +10:00
|
|
|
|
|
|
|
func (s *StashEntry) ID() string {
|
|
|
|
return s.RefName()
|
|
|
|
}
|
2020-08-22 10:14:53 +10:00
|
|
|
|
|
|
|
func (s *StashEntry) Description() string {
|
|
|
|
return s.RefName() + ": " + s.Name
|
|
|
|
}
|