summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-29 18:46:45 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 20:48:49 +1000
commit91f0b0e28fb93bf715a4fda67fcbb400ffbc680b (patch)
treeaa6e19417268c86129e967997582006bfb6f3784 /pkg/commands/git.go
parent8d2af5cc61c8bc94da6f608598ff27aead491c6a (diff)
move stash panel
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index e7fcbd634..2d75330e6 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -200,10 +200,10 @@ func findDotGitDir(stat func(string) (os.FileInfo, error), readFile func(filenam
return strings.TrimSpace(strings.TrimPrefix(fileContent, "gitdir: ")), nil
}
-func (c *GitCommand) getUnfilteredStashEntries() []*StashEntry {
+func (c *GitCommand) getUnfilteredStashEntries() []*models.StashEntry {
unescaped := "git stash list --pretty='%gs'"
rawString, _ := c.OSCommand.RunCommandWithOutput(unescaped)
- stashEntries := []*StashEntry{}
+ stashEntries := []*models.StashEntry{}
for i, line := range utils.SplitLines(rawString) {
stashEntries = append(stashEntries, stashEntryFromLine(line, i))
}
@@ -211,7 +211,7 @@ func (c *GitCommand) getUnfilteredStashEntries() []*StashEntry {
}
// GetStashEntries stash entries
-func (c *GitCommand) GetStashEntries(filterPath string) []*StashEntry {
+func (c *GitCommand) GetStashEntries(filterPath string) []*models.StashEntry {
if filterPath == "" {
return c.getUnfilteredStashEntries()
}
@@ -221,8 +221,8 @@ func (c *GitCommand) GetStashEntries(filterPath string) []*StashEntry {
if err != nil {
return c.getUnfilteredStashEntries()
}
- stashEntries := []*StashEntry{}
- var currentStashEntry *StashEntry
+ stashEntries := []*models.StashEntry{}
+ var currentStashEntry *models.StashEntry
lines := utils.SplitLines(rawString)
isAStash := func(line string) bool { return strings.HasPrefix(line, "stash@{") }
re := regexp.MustCompile(`stash@\{(\d+)\}`)
@@ -249,8 +249,8 @@ outer:
return stashEntries
}
-func stashEntryFromLine(line string, index int) *StashEntry {
- return &StashEntry{
+func stashEntryFromLine(line string, index int) *models.StashEntry {
+ return &models.StashEntry{
Name: line,
Index: index,
}