diff --git a/pkg/commands/branch_list_builder.go b/pkg/commands/branch_list_builder.go index d7a23205512..e5af7685326 100644 --- a/pkg/commands/branch_list_builder.go +++ b/pkg/commands/branch_list_builder.go @@ -47,7 +47,9 @@ func (b *BranchListBuilder) obtainCurrentBranch() *Branch { func (b *BranchListBuilder) obtainReflogBranches() []*Branch { branches := make([]*Branch, 0) - rawString, err := b.GitCommand.OSCommand.RunCommandWithOutput("git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD") + // if we directly put this string in RunCommandWithOutput the compiler complains because it thinks it's a format string + unescaped := "git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD" + rawString, err := b.GitCommand.OSCommand.RunCommandWithOutput(unescaped) if err != nil { return branches } diff --git a/pkg/commands/git.go b/pkg/commands/git.go index fe0600065ee..3464215c72b 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -157,7 +157,9 @@ func findDotGitDir(stat func(string) (os.FileInfo, error), readFile func(filenam // GetStashEntries stash entries func (c *GitCommand) GetStashEntries() []*StashEntry { - rawString, _ := c.OSCommand.RunCommandWithOutput("git stash list --pretty='%gs'") + // if we directly put this string in RunCommandWithOutput the compiler complains because it thinks it's a format string + unescaped := "git stash list --pretty='%gs'" + rawString, _ := c.OSCommand.RunCommandWithOutput(unescaped) stashEntries := []*StashEntry{} for i, line := range utils.SplitLines(rawString) { stashEntries = append(stashEntries, stashEntryFromLine(line, i))