From 4cd604a885853a7c685553d70d790c7afb38ec86 Mon Sep 17 00:00:00 2001 From: Yashodhan Ghadge Date: Thu, 21 Oct 2021 20:25:53 +0530 Subject: [PATCH] * moving cloning back to remote url (since this makes it compatible with more go versions) --- clone_test.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/clone_test.go b/clone_test.go index 9644781..cd6442d 100644 --- a/clone_test.go +++ b/clone_test.go @@ -4,6 +4,7 @@ import ( "github.com/sosedoff/gitkit" "io/ioutil" "net/http/httptest" + "os" "testing" ) @@ -89,25 +90,16 @@ func StartHTTP(repoDir string) (*httptest.Server, error) { return server, nil } -// TestCloneWithExternalHTTPUrWithLocalServer -func TestCloneWithExternalHTTPUrWithLocalServer(t *testing.T) { +// TestCloneWithExternalHTTPUrl +func TestCloneWithExternalHTTPUrl(t *testing.T) { - // create an empty repo - repo := createTestRepo(t) - defer cleanupTestRepo(t, repo) - - seedTestRepo(t, repo) - - // initialize a git server at the path of the newly created repo - serv, err := StartHTTP(repo.Workdir()) - checkFatal(t, err) - - // clone the repo - url := serv.URL + "/.git" path, err := ioutil.TempDir("", "git2go") defer os.RemoveAll(path) + + // clone the repo + url := "https://github.com/libgit2/TestGitRepository" _, err = Clone(url, path, &CloneOptions{}) if err != nil { - t.Fatal("cannot clone remote repo via http, error: ", err) + t.Fatal("cannot clone remote repo via https, error: ", err) } }