From f1fa96c7b7f548389c7560d3a1a0bce83be56c9f Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sun, 5 Sep 2021 15:44:18 -0700 Subject: Add support for custom smart transports (#806) This change adds support for git smart transports. This will be then used to implement http, https, and ssh transports that don't rely on the libgit2 library. --- git.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'git.go') diff --git a/git.go b/git.go index 3f51048..adf07ae 100644 --- a/git.go +++ b/git.go @@ -128,6 +128,7 @@ var ( type doNotCompare [0]func() var pointerHandles *HandleList +var remotePointers *remotePointerList func init() { initLibGit2() @@ -135,6 +136,7 @@ func init() { func initLibGit2() { pointerHandles = NewHandleList() + remotePointers = newRemotePointerList() C.git_libgit2_init() @@ -160,7 +162,11 @@ func initLibGit2() { // After this is called, invoking any function from this library will result in // undefined behavior, so make sure this is called carefully. func Shutdown() { + if err := unregisterManagedTransports(); err != nil { + panic(err) + } pointerHandles.Clear() + remotePointers.clear() C.git_libgit2_shutdown() } -- cgit v1.2.3