diff options
author | Nao YONASHIRO <owan.orisano@gmail.com> | 2019-07-25 17:56:22 +0900 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2019-07-25 10:56:22 +0200 |
commit | 8beb3ee82048ec6be5471c7a056b72e89346898a (patch) | |
tree | 77c46a623f6a20cb7d45a26fde62283d192a9895 /repository_test.go | |
parent | c363771e002cbdf4dcf8a9cc5f1fefdd5769f5dd (diff) | |
download | go-git-8beb3ee82048ec6be5471c7a056b72e89346898a.tar.gz |
Worktree: improve build index performance. (#1179)
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 20 |
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() + } +} |