aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorNao YONASHIRO <owan.orisano@gmail.com>2019-07-25 17:56:22 +0900
committerMáximo Cuadros <mcuadros@gmail.com>2019-07-25 10:56:22 +0200
commit8beb3ee82048ec6be5471c7a056b72e89346898a (patch)
tree77c46a623f6a20cb7d45a26fde62283d192a9895 /repository_test.go
parentc363771e002cbdf4dcf8a9cc5f1fefdd5769f5dd (diff)
downloadgo-git-8beb3ee82048ec6be5471c7a056b72e89346898a.tar.gz
Worktree: improve build index performance. (#1179)
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go
index 0148c78..32fa4fa 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -16,6 +16,7 @@ import (
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
openpgperr "golang.org/x/crypto/openpgp/errors"
+
"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
@@ -2671,3 +2672,22 @@ func BenchmarkObjects(b *testing.B) {
})
}
}
+
+func BenchmarkPlainClone(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ t, err := ioutil.TempDir("", "")
+ if err != nil {
+ b.Fatal(err)
+ }
+ _, err = PlainClone(t, false, &CloneOptions{
+ URL: "https://github.com/knqyf263/vuln-list",
+ Depth: 1,
+ })
+ if err != nil {
+ b.Error(err)
+ }
+ b.StopTimer()
+ os.RemoveAll(t)
+ b.StartTimer()
+ }
+}