mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-08 04:04:22 +02:00
chore: use null char as a stash entries divider during loading
This commit is contained in:
parent
bc330b8ff3
commit
50044dd5e0
@ -32,14 +32,14 @@ func (self *StashLoader) GetStashEntries(filterPath string) []*models.StashEntry
|
|||||||
return self.getUnfilteredStashEntries()
|
return self.getUnfilteredStashEntries()
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdArgs := NewGitCmd("stash").Arg("list", "--name-only", "--pretty=%ct|%gs").ToArgv()
|
cmdArgs := NewGitCmd("stash").Arg("list", "-z", "--name-only", "--pretty=%ct|%gs").ToArgv()
|
||||||
rawString, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
rawString, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return self.getUnfilteredStashEntries()
|
return self.getUnfilteredStashEntries()
|
||||||
}
|
}
|
||||||
stashEntries := []*models.StashEntry{}
|
stashEntries := []*models.StashEntry{}
|
||||||
var currentStashEntry *models.StashEntry
|
var currentStashEntry *models.StashEntry
|
||||||
lines := utils.SplitLines(rawString)
|
lines := utils.SplitNul(rawString)
|
||||||
isAStash := func(line string) bool { return strings.HasPrefix(line, "stash@{") }
|
isAStash := func(line string) bool { return strings.HasPrefix(line, "stash@{") }
|
||||||
re := regexp.MustCompile(`stash@\{(\d+)\}`)
|
re := regexp.MustCompile(`stash@\{(\d+)\}`)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user