use refspec to set remote

This commit is contained in:
Tim Schubert 2022-05-31 19:34:18 +02:00
parent 707535e6fd
commit 9947e7c707
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA

View file

@ -123,9 +123,12 @@ func Push(
auth *githttp.BasicAuth,
remote *git.Remote,
) error {
refspec := fmt.Sprintf("+refs/heads/*:refs/remotes/%s/*", DefaultRemoteName)
return remote.Push(&git.PushOptions{
RemoteName: DefaultRemoteName,
Auth: auth,
RefSpecs: []config.RefSpec { config.RefSpec(refspec) },
})
}