aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/repository.go b/repository.go
index b9afb9a..3c77188 100644
--- a/repository.go
+++ b/repository.go
@@ -346,6 +346,20 @@ func (r *Repository) Fetch(o *FetchOptions) error {
return remote.Fetch(o)
}
+// Push pushes changes to a remote.
+func (r *Repository) Push(o *PushOptions) error {
+ if err := o.Validate(); err != nil {
+ return err
+ }
+
+ remote, err := r.Remote(o.RemoteName)
+ if err != nil {
+ return err
+ }
+
+ return remote.Push(o)
+}
+
// object.Commit return the commit with the given hash
func (r *Repository) Commit(h plumbing.Hash) (*object.Commit, error) {
return object.GetCommit(r.s, h)