Add a ReInit function #647
11
git.go
11
git.go
|
@ -149,6 +149,17 @@ func Shutdown() {
|
|||
C.git_libgit2_shutdown()
|
||||
}
|
||||
|
||||
// ReInit reinitializes the global state, this is useful if the effective user
|
||||
// id has changed and you want to update the stored search paths for gitconfig
|
||||
// files. This function frees any references to objects, so it should be called
|
||||
// before any other functions are called.
|
||||
func ReInit() {
|
||||
pointerHandles.Clear()
|
||||
C.git_libgit2_shutdown()
|
||||
pointerHandles = NewHandleList()
|
||||
C.git_libgit2_init()
|
||||
}
|
||||
|
||||
// Oid represents the id for a Git object.
|
||||
type Oid [20]byte
|
||||
|
||||
|
|
Loading…
Reference in New Issue