mirror of
https://github.com/thegeeklab/wp-git-clone.git
synced 2024-09-20 01:22:47 +02:00
28 lines
337 B
Go
28 lines
337 B
Go
|
package git
|
||
|
|
||
|
import (
|
||
|
"golang.org/x/sys/execabs"
|
||
|
)
|
||
|
|
||
|
// RemoteRemove drops the defined remote from a git repo.
|
||
|
func Init(repo Repository) *execabs.Cmd {
|
||
|
args := []string{
|
||
|
"init",
|
||
|
}
|
||
|
|
||
|
if repo.Branch != "" {
|
||
|
args = []string{
|
||
|
"init",
|
||
|
"-b",
|
||
|
repo.Branch,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
cmd := execabs.Command(
|
||
|
gitBin,
|
||
|
args...,
|
||
|
)
|
||
|
|
||
|
return cmd
|
||
|
}
|