diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-05-19 20:18:02 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-05-20 20:54:24 +1000 |
commit | 25f8b0337e1e023fd9575ecd46467810c9f49824 (patch) | |
tree | da4937d66b110d6f69621c79d98c3d9ce9384b41 /pkg/commands/git_commands/stash_loader.go | |
parent | 63ddc52a6b0b69b656b106ee5ae74dd736ac6317 (diff) |
Add convenience builder for git commands
Diffstat (limited to 'pkg/commands/git_commands/stash_loader.go')
-rw-r--r-- | pkg/commands/git_commands/stash_loader.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/stash_loader.go b/pkg/commands/git_commands/stash_loader.go index 0dea81c2c..580287256 100644 --- a/pkg/commands/git_commands/stash_loader.go +++ b/pkg/commands/git_commands/stash_loader.go @@ -32,7 +32,8 @@ func (self *StashLoader) GetStashEntries(filterPath string) []*models.StashEntry return self.getUnfilteredStashEntries() } - rawString, err := self.cmd.New("git stash list --name-only").DontLog().RunWithOutput() + cmdStr := NewGitCmd("stash").Arg("list", "--name-only").ToString() + rawString, err := self.cmd.New(cmdStr).DontLog().RunWithOutput() if err != nil { return self.getUnfilteredStashEntries() } @@ -65,7 +66,9 @@ outer: } func (self *StashLoader) getUnfilteredStashEntries() []*models.StashEntry { - rawString, _ := self.cmd.New("git stash list -z --pretty='%gs'").DontLog().RunWithOutput() + cmdStr := NewGitCmd("stash").Arg("list", "-z", "--pretty='%gs'").ToString() + + rawString, _ := self.cmd.New(cmdStr).DontLog().RunWithOutput() return slices.MapWithIndex(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry { return self.stashEntryFromLine(line, index) }) |