This change introduces the file deprecated.go, which contains any
constants, functions, and types that are slated to be deprecated in the
next major release.
These symbols are deprecated because they refer to old spellings in
pre-1.0 libgit2. This also makes the build be done with the
`-DDEPRECATE_HARD` flag to avoid regressions.
This, together with
[gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should
make releases safer going forward.
1: More information about how that works at
https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
(cherry picked from commit 137c05e802)
An Object should be about representing a libgit2 object rather than
showing which methods it should support.
Change any return of Object to *Object and provide methods to convert
between this and the particular type.
While Go will assign the correct type to a const block when it
auto-creates the values, assigning makes the const be typeless and will
only gain it in each particular use.
Make each constant in the blocks have an assigned type.
Otherwise, the garbage collector might decide it's a good idea to throw
away the repository instance while the C object still has a pointer to
it. Hilarity ensues.
This is needed to get runtime.SetFinalizer to work, which
expects a pointer-receiver. Without it the runtime will crash, when it
tries to garbage-collect an object.