summaryrefslogtreecommitdiff
path: root/transport.go
diff options
context:
space:
mode:
authorYashodhan Ghadge <[email protected]>2021-10-23 20:33:10 +0300
committerGitHub <[email protected]>2021-10-23 10:33:10 -0700
commit0e8009f00a65034d196c67b1cdd82af6f12c34d3 (patch)
tree26ea2a1a90daac40ab95aecbcbf98fa156223177 /transport.go
parent6eae74c128e37e590d3a5da3fe0561add4b94d5c (diff)
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
Diffstat (limited to 'transport.go')
-rw-r--r--transport.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/transport.go b/transport.go
index 1afa6f4..23514b4 100644
--- a/transport.go
+++ b/transport.go
@@ -22,7 +22,6 @@ void _go_git_setup_smart_subtransport_stream(_go_managed_smart_subtransport_stre
*/
import "C"
import (
- "errors"
"fmt"
"io"
"reflect"
@@ -306,8 +305,10 @@ func smartTransportCallback(
registeredSmartTransport := pointerHandles.Get(handle).(*RegisteredSmartTransport)
remote, ok := remotePointers.get(owner)
if !ok {
- err := errors.New("remote pointer not found")
- return setCallbackError(errorMessage, err)
+ // create a new empty remote and set it
+ // as a weak pointer, so that control stays in golang
+ remote = createNewEmptyRemote()
+ remote.weak = true
}
managed := &managedSmartSubtransport{