aboutsummaryrefslogtreecommitdiffstats
path: root/examples/push
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:24:07 +0100
committerGitHub <noreply@github.com>2017-01-30 16:24:07 +0100
commita24e40af0aa2d9d512051269993a1b08c0496d12 (patch)
tree65936a6a365263c93e4b57c3b67aad6a13489e68 /examples/push
parenta48bc6e17ef6298f93ec21cdf1a5e387640673b6 (diff)
parent35378e7db9288e8244f2634a1b47981606731cef (diff)
downloadgo-git-a24e40af0aa2d9d512051269993a1b08c0496d12.tar.gz
Merge pull request #229 from mcuadros/worktree
Worktree and new Repository Contructors
Diffstat (limited to 'examples/push')
-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")
}