From acb1dc80d93f45a055b14903679abca3a6e994f6 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Sun, 29 Jan 2017 02:27:16 +0100 Subject: example: using new constructors --- examples/push/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'examples/push/main.go') 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("") - repoPath := os.Args[1] + CheckArgs("") + 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") } -- cgit