aboutsummaryrefslogtreecommitdiffstats
path: root/examples/push/main.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-29 02:27:16 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-29 22:36:15 +0100
commitacb1dc80d93f45a055b14903679abca3a6e994f6 (patch)
treea7e29fd677bb5c11df85fca1fcb6d015bc40fa7b /examples/push/main.go
parent352170d1bf8cc7b32b85d8a2740eb3627e952a6e (diff)
downloadgo-git-acb1dc80d93f45a055b14903679abca3a6e994f6.tar.gz
example: using new constructors
Diffstat (limited to 'examples/push/main.go')
-rw-r--r--examples/push/main.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/push/main.go b/examples/push/main.go
index 9a30599..250e5fe 100644
--- a/examples/push/main.go
+++ b/examples/push/main.go
@@ -1,7 +1,6 @@
package main
import (
- "fmt"
"os"
"gopkg.in/src-d/go-git.v4"
@@ -9,14 +8,13 @@ import (
)
func main() {
- CheckArgs("<repo path>")
- repoPath := os.Args[1]
+ CheckArgs("<repository-path>")
+ path := os.Args[1]
- repo, err := git.NewFilesystemRepository(repoPath)
+ r, err := git.PlainOpen(path)
CheckIfError(err)
- err = repo.Push(&git.PushOptions{})
+ Info("git push")
+ err = r.Push(&git.PushOptions{})
CheckIfError(err)
-
- fmt.Print("pushed")
}