Browse Source

Use local repository in tests if available

Vadim Markovtsev 7 năm trước cách đây
mục cha
commit
3f50ce55d2
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  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",
 	})