aboutsummaryrefslogtreecommitdiffstats
path: root/examples/push/main.go
diff options
context:
space:
mode:
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")
}