aboutsummaryrefslogtreecommitdiffstats
path: root/examples/custom_http/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/custom_http/main.go')
-rw-r--r--examples/custom_http/main.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/custom_http/main.go b/examples/custom_http/main.go
index 0853569..19f2ca3 100644
--- a/examples/custom_http/main.go
+++ b/examples/custom_http/main.go
@@ -11,6 +11,7 @@ import (
. "gopkg.in/src-d/go-git.v4/examples"
"gopkg.in/src-d/go-git.v4/plumbing/transport/client"
githttp "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
+ "gopkg.in/src-d/go-git.v4/storage/memory"
)
// Here is an example to configure http client according to our own needs.
@@ -37,13 +38,10 @@ func main() {
// Override http(s) default protocol to use our custom client
client.InstallProtocol("https", githttp.NewClient(customClient))
- // Create an in-memory repository
- r := git.NewMemoryRepository()
-
// Clone repository using the new client if the protocol is https://
Info("git clone %s", url)
- err := r.Clone(&git.CloneOptions{URL: url})
+ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url})
CheckIfError(err)
// Retrieve the branch pointed by HEAD