summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2021-09-05 15:44:18 -0700
committerGitHub <[email protected]>2021-09-05 15:44:18 -0700
commitf1fa96c7b7f548389c7560d3a1a0bce83be56c9f (patch)
treed78a98f00e1d1e1419ca14223784f15db2de2b18 /git.go
parentdbe032c347b1a1308a4b880e7c5a06d8dfb4d507 (diff)
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.
Diffstat (limited to 'git.go')
-rw-r--r--git.go6
1 files changed, 6 insertions, 0 deletions
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()
}