Be more strict with git arguments (#7715)
* Be more strict with git arguments * fix-up commit test * use bindings for branch name
This commit is contained in:
parent
1d8915ad5d
commit
7ad67109d7
12 changed files with 41 additions and 20 deletions
|
@ -187,8 +187,7 @@ func Pull(repoPath string, opts PullRemoteOptions) error {
|
|||
if opts.All {
|
||||
cmd.AddArguments("--all")
|
||||
} else {
|
||||
cmd.AddArguments(opts.Remote)
|
||||
cmd.AddArguments(opts.Branch)
|
||||
cmd.AddArguments("--", opts.Remote, opts.Branch)
|
||||
}
|
||||
|
||||
if opts.Timeout <= 0 {
|
||||
|
@ -213,7 +212,7 @@ func Push(repoPath string, opts PushOptions) error {
|
|||
if opts.Force {
|
||||
cmd.AddArguments("-f")
|
||||
}
|
||||
cmd.AddArguments(opts.Remote, opts.Branch)
|
||||
cmd.AddArguments("--", opts.Remote, opts.Branch)
|
||||
_, err := cmd.RunInDirWithEnv(repoPath, opts.Env)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue