aboutsummaryrefslogtreecommitdiffstats
path: root/examples/showcase
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/showcase
parent352170d1bf8cc7b32b85d8a2740eb3627e952a6e (diff)
downloadgo-git-acb1dc80d93f45a055b14903679abca3a6e994f6.tar.gz
example: using new constructors
Diffstat (limited to 'examples/showcase')
-rw-r--r--examples/showcase/main.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/showcase/main.go b/examples/showcase/main.go
index 4d1206d..0b9d82e 100644
--- a/examples/showcase/main.go
+++ b/examples/showcase/main.go
@@ -12,16 +12,15 @@ import (
)
func main() {
- CheckArgs("<url>")
+ CheckArgs("<url> <path>")
url := os.Args[1]
-
- r := git.NewMemoryRepository()
+ path := os.Args[2]
// Clone the given repository, creating the remote, the local branches
// and fetching the objects, exactly as:
- Info("git clone %s", url)
+ Info("git clone %s %s", url, path)
- err := r.Clone(&git.CloneOptions{URL: url})
+ r, err := git.PlainClone(path, false, &git.CloneOptions{URL: url})
CheckIfError(err)
// Getting the latest commit on the current branch