diff --git a/main.go b/main.go index 44beffb..62137a5 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/transport" @@ -379,18 +380,20 @@ func update(repository *git.Repository, branch string, auth transport.AuthMethod // push log.Debug("Pushing the changes") - //err = repository.Push(&git.PushOptions{ - // Auth: auth, - // Progress: os.Stdout, - // RemoteName: "origin", - // RefSpecs: []config.RefSpec{ - // config.RefSpec(fmt.Sprintf("refs/heads/%s:refs/heads/%s", branch, branch)), - // }, - //}) + err = repository.Push(&git.PushOptions{ + Auth: auth, + Progress: os.Stdout, + RemoteName: "origin", + RefSpecs: []config.RefSpec{ + config.RefSpec(fmt.Sprintf("refs/heads/%s:refs/heads/%s", branch, branch)), + }, + }) if err != nil { panic(err) } + + log.Info("Update complete") } func listen(addr string) {