From 0dfa07865345750bd2c99a77bf7f3dc0a6b2b6ac Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 11 Jul 2025 16:19:29 +0200 Subject: [PATCH] Revert "chore: use null char as a stash entries divider during loading" This was not a good idea, and it seems it has never been tested: the --name-only and -z options don't work well together. Specifically, -z seems to simply cancel --name-only. This is not enough to make it work, we'll need more fixes in the next commit. This reverts commit 50044dd5e0ad7d00ea1dbbf0b7c8c97a32bf3af2. --- pkg/commands/git_commands/stash_loader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/commands/git_commands/stash_loader.go b/pkg/commands/git_commands/stash_loader.go index d0a290507..5ec5d4ed4 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", "-z", "--name-only", "--pretty=%ct|%gs").ToArgv() + cmdArgs := NewGitCmd("stash").Arg("list", "--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.SplitNul(rawString) + lines := utils.SplitLines(rawString) isAStash := func(line string) bool { return strings.HasPrefix(line, "stash@{") } re := regexp.MustCompile(`stash@\{(\d+)\}`)