Commit Graph

12 Commits

Author SHA1 Message Date
lhchavez 5d8eaf7e65
Refactor all callbacks (#700)
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`.
2020-12-05 13:13:59 -08:00
lhchavez 137c05e802
Mark some symbols to be deprecated #minor (#698)
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
2020-12-05 07:23:44 -08:00
Dinesh Bolkensteyn 5c79683685 Similar to #513 Fix potential segfault on Tag objects 2019-11-17 17:41:43 +01:00
Carlos Martín Nieto 916d555644 tag: accept an Objecter for creating a tag
This lets us create a tag for any kind of object.
2017-07-08 23:22:33 +02:00
Carlos Martín Nieto 7f685a6ee6 Add Objecer interface
We do want to be able to accept generic objects in functions. Add this interface
so we can accept that instead of specific object types.
2017-07-08 22:53:50 +02:00
Carlos Martín Nieto 55a1096141 Third round of keep-alive aditions 2017-07-08 16:07:51 +02:00
Mirko Nosenzo 8b855ce765 Tag Remove
Added support for removal of a Tag
2016-05-29 14:57:00 +02:00
Carlos Martín Nieto b7159b0cd4 Move from an Object interface to a type
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.
2015-08-04 14:47:10 +02:00
Carlos Martín Nieto def4494b74 Move CreateTag to the tags collection 2015-07-31 20:23:05 +02:00
Calin Seciu 6c4af98c5b Add more support for tags
Implement support for the following libgit2 functions:

- 'git_tag_list' and 'git_tag_list_match'
- 'git_tag_foreach'
- 'git_tag_create_lightweight'
2015-07-31 10:07:26 +02:00
Calin Seciu 12311c8528 Add TagsCollection 2015-07-31 09:51:19 +02:00
Frank Benkstein bbdc7a825d add support for annotated tags 2014-06-09 23:19:17 +02:00