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