diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-10-06 23:26:25 +0900 |
---|---|---|
committer | Ryooooooga <eial5q265e5@gmail.com> | 2021-10-08 18:36:05 +0900 |
commit | 292b780bd8e628cea253226f97849f65cd097463 (patch) | |
tree | 9215fb5ccc0efb846a1c06f5f341d2ac3abfef38 /pkg/commands/loading_commits.go | |
parent | e19b4fe369c0ff0947c1980dbc579e88f528fd68 (diff) |
Quote branch names and remote names
Diffstat (limited to 'pkg/commands/loading_commits.go')
-rw-r--r-- | pkg/commands/loading_commits.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/commands/loading_commits.go b/pkg/commands/loading_commits.go index 28e9c5199..e7d27e094 100644 --- a/pkg/commands/loading_commits.go +++ b/pkg/commands/loading_commits.go @@ -322,7 +322,7 @@ func (c *CommitListBuilder) getMergeBase(refName string) (string, error) { } // swallowing error because it's not a big deal; probably because there are no commits yet - output, _ := c.OSCommand.RunCommandWithOutput("git merge-base %s %s", refName, baseBranch) + output, _ := c.OSCommand.RunCommandWithOutput("git merge-base %s %s", c.OSCommand.Quote(refName), c.OSCommand.Quote(baseBranch)) return ignoringWarnings(output), nil } @@ -339,7 +339,7 @@ func ignoringWarnings(commandOutput string) string { // getFirstPushedCommit returns the first commit SHA which has been pushed to the ref's upstream. // all commits above this are deemed unpushed and marked as such. func (c *CommitListBuilder) getFirstPushedCommit(refName string) (string, error) { - output, err := c.OSCommand.RunCommandWithOutput("git merge-base %s %s@{u}", refName, refName) + output, err := c.OSCommand.RunCommandWithOutput("git merge-base %s %s@{u}", c.OSCommand.Quote(refName), c.OSCommand.Quote(refName)) if err != nil { return "", err } @@ -362,7 +362,7 @@ func (c *CommitListBuilder) getLogCmd(opts GetCommitsOptions) *exec.Cmd { return c.OSCommand.ExecutableFromString( fmt.Sprintf( "git log %s --oneline --pretty=format:\"%%H%s%%at%s%%aN%s%%d%s%%p%s%%s\" %s --abbrev=%d --date=unix %s", - opts.RefName, + c.OSCommand.Quote(opts.RefName), SEPARATION_CHAR, SEPARATION_CHAR, SEPARATION_CHAR, |