Commit Graph

11 Commits

Author SHA1 Message Date
github-actions[bot] bb7920d61f
Make all non-user-creatable structures non-comparable (#802) (#803)
This change makes all non-user-creatable structures non-comparable. This
makes it easier to add changes later that don't introduce breaking
changes from the go compatibility guarantees perspective.

This, of course, implies that this change _is_ a breaking change, but since
these structures are not intended to be created by users (or de-referenced),
it should be okay.

(cherry picked from commit dbe032c347)

Co-authored-by: lhchavez <lhchavez@lhchavez.com>
2021-09-05 14:00:24 -07:00
github-actions[bot] d21ba51f4e
More callback refactoring (#713) (#717)
This change:

* Gets rid of the `.toC()` functions for Options objects, since they
  were redundant with the `populateXxxOptions()`.
* Adds support for `errorTarget` to the `RemoteOptions`, since they are
  used in the same stack for some functions (like `Fetch()`). Now for
  those cases, the error returned by the callback will be preserved
  as-is.

(cherry picked from commit 10c67474a8)

Co-authored-by: lhchavez <lhchavez@lhchavez.com>
2020-12-10 18:01:41 -08:00
github-actions[bot] b7d6ab837c
Refactor all callbacks (#700) (#703)
This change is a preparation for another change that makes all callback
types return a Go error instead of an error code / an integer. That is
going to make make things a lot more idiomatic.

The reason this change is split is threefold:

a) This change is mostly mechanical and should contain no semantic
   changes.
b) This change is backwards-compatible (in the Go API compatibility
   sense of the word), and thus can be backported to all other releases.
c) It makes the other change a bit smaller and more focused on just one
   thing.

Concretely, this change makes all callbacks populate a Go error when
they fail. If the callback is invoked from the same stack as the
function to which it was passed (e.g. for `Tree.Walk`), it will preserve
the error object directly into a struct that also holds the callback
function. Otherwise if the callback is pased to one func and will be
invoked when run from another one (e.g. for `Repository.InitRebase`),
the error string is saved into the libgit2 thread-local storage and then
re-created as a `GitError`.

(cherry picked from commit 5d8eaf7e65)

Co-authored-by: lhchavez <lhchavez@lhchavez.com>
2020-12-05 16:23:04 -08:00
github-actions[bot] a54915d90b
Mark some symbols to be deprecated #minor (#698) (#699)
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)
2020-12-05 11:43:02 -08:00
Suhaib Mujahid 5b6ce70b89
refactor: Use undeprecated options init (#656)
This PR move form linking against the deprecated `init_options` functions to the renamed `options_init` functions.

For more context see libgit2/libgit2@0b5ba0d744 and libgit2/libgit2@c6184f0c4b.
2020-10-22 06:18:11 -07:00
Carlos Martín Nieto 97e6392d3a Adjust to libgit2 changes 2019-12-10 22:15:32 +00:00
Carlos Martín Nieto 55a1096141 Third round of keep-alive aditions 2017-07-08 16:07:51 +02:00
Calin Seciu 71ff6ab0d5 Fix error after updating to latest changes 2016-02-20 14:58:48 +02:00
Calin Seciu dc4409793d Remove Untrack() from free() function
https://github.com/libgit2/git2go/pull/257#discussion_r53443211
2016-02-20 14:44:20 +02:00
Calin Seciu 5191254a66 Fix problems based on PR comments
https://github.com/libgit2/git2go/pull/257#discussion_r53432957
https://github.com/libgit2/git2go/pull/257#discussion_r53443418
2016-02-20 14:43:46 +02:00
Calin Seciu d54ea1d6a8 Add stash support 2015-09-21 14:50:57 +03:00