summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/stash_loader.go
diff options
context:
space:
mode:
authorAzraelSec <me@azraelsec.sh>2023-12-21 19:21:13 +0100
committerStefan Haller <stefan@haller-berlin.de>2023-12-27 11:21:49 +0100
commit50044dd5e0ad7d00ea1dbbf0b7c8c97a32bf3af2 (patch)
tree3461a7624d717ca3c1046924a2efd15e42be4a20 /pkg/commands/git_commands/stash_loader.go
parentbc330b8ff3ef7533bc1f96c7d2b309eaf94adf61 (diff)
chore: use null char as a stash entries divider during loading
Diffstat (limited to 'pkg/commands/git_commands/stash_loader.go')
-rw-r--r--pkg/commands/git_commands/stash_loader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/stash_loader.go b/pkg/commands/git_commands/stash_loader.go
index 318e1ce0f..f97cc718a 100644
--- a/pkg/commands/git_commands/stash_loader.go
+++ b/pkg/commands/git_commands/stash_loader.go
@@ -32,14 +32,14 @@ func (self *StashLoader) GetStashEntries(filterPath string) []*models.StashEntry
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()
if err != nil {
return self.getUnfilteredStashEntries()
}
stashEntries := []*models.StashEntry{}
var currentStashEntry *models.StashEntry
- lines := utils.SplitLines(rawString)
+ lines := utils.SplitNul(rawString)
isAStash := func(line string) bool { return strings.HasPrefix(line, "stash@{") }
re := regexp.MustCompile(`stash@\{(\d+)\}`)