From 0e8009f00a65034d196c67b1cdd82af6f12c34d3 Mon Sep 17 00:00:00 2001 From: Yashodhan Ghadge Date: Sat, 23 Oct 2021 20:33:10 +0300 Subject: bugfix: HTTPS Clone fails with remote pointer not found using Go transport (#836) (#842) Fixes: #836 Changes: * adding a weak bool param for Remote * create a new remote in the smartTransportCallback incase one is not found --- clone_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clone_test.go') diff --git a/clone_test.go b/clone_test.go index 8814dd0..9ff03e6 100644 --- a/clone_test.go +++ b/clone_test.go @@ -2,6 +2,7 @@ package git import ( "io/ioutil" + "os" "testing" ) @@ -70,3 +71,17 @@ func TestCloneWithCallback(t *testing.T) { } defer remote.Free() } + +// TestCloneWithExternalHTTPUrl +func TestCloneWithExternalHTTPUrl(t *testing.T) { + + 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 https, error: ", err) + } +} -- cgit v1.2.3