浏览代码

Use local repository in tests if available

Vadim Markovtsev 7 年之前
父节点
当前提交
3f50ce55d2
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      pipeline_test.go

+ 7 - 0
pipeline_test.go

@@ -218,6 +218,13 @@ func TestPipelineError(t *testing.T) {
 }
 
 func init() {
+	cwd, err := os.Getwd()
+	if err == nil {
+		testRepository, err = git.PlainOpen(cwd)
+		if err == nil {
+			return
+		}
+	}
 	testRepository, _ = git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
 		URL: "https://github.com/src-d/hercules",
 	})