>It doesn't work

You might want to try to use an `out` parameter here.

>I want pass **null** pointer to safeHandle, not pointer to safeHandle that store **null**. I used for this reason IntPtr 

I know this sounds a bit counter-intuitive, but `NullRepositorySafeHandle` is nothing else than a `SafeHandle` wrapping `IntPtr.Zero`.

See nulltoken/libgit2sharp@bde1f860f411c07fc08079fbe1f23b742dffbd5a for a little bit of help

Interop is an amazing path to joy, isn't it? :wink: