Commit Graph

46 Commits

Author SHA1 Message Date
lhchavez e28cce87c7
Ensure that no pointer handles leak during the test (#712)
This change makes sure that pointer handles are correctly cleaned up
during tests.
2020-12-10 05:35:40 -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
Segev Finer 2bd574b6bd
Add ReferenceNormalizeName (#681) 2020-11-13 16:50:59 -08:00
Carlos Martín Nieto ee6dff2f8e Use git_object_t instead of deprecated git_otype 2019-01-05 10:48:42 +00:00
Michel Lespinasse a2de5ababa git2go: fix reference iterator leak
This fixes a leak that was apparently introduced in commit 55a1096141.
2018-05-30 14:15:59 -07:00
Josh Bleecher Snyder 589ec2bc28 reference: minor doc improvements 2018-02-15 09:39:26 -08:00
Carlos Martín Nieto 55a1096141 Third round of keep-alive aditions 2017-07-08 16:07:51 +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
Calin Seciu ec93213f21 Add ReferenceIsValidName() 2015-07-24 12:14:53 +03:00
Calin Seciu 4b88210cbf Add check if reference is a note 2015-07-24 12:14:24 +03:00
Carlos Martín Nieto 01a2d8d38d Create a ReferenceCollection for managing references
As with the other commits, this clears up the clutter in naming and
around the Repository's API.
2015-06-28 01:12:32 +02:00
Carlos Martín Nieto c4fce1a218 Update to libgit2 d675982a153
There's been some changes to the checkout strategy, especially the
SAFE_CREATE mode, which is now the RECREATE_MISSING flag, though that
shouldn't be necessary to use in the general case.

The largest changes come from the removal of the signture from
ref-modifying functions/methods and the removal of the reflog string in
all but those directly related to moving references.
2015-03-15 01:49:32 +01:00
Mark Probst e439b931a6 Default signature 2015-03-04 15:52:57 -08:00
Carlos Martín Nieto a9d993f3d1 Remove useless includes 2014-12-11 02:59:07 +01:00
Carlos Martín Nieto 8c631b0c25 Add missing thread locking 2014-12-06 02:45:26 +01:00
Carlos Martín Nieto 668aa5dae1 Make the constants have types
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.
2014-10-28 11:29:31 +01:00
Carlos Martín Nieto 8a73c75f1a Keep a pointer to the repository in the objects and references
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.
2014-05-26 09:28:07 +02:00
Carlos Martín Nieto 2942e18d05 Give Object and Reference an Onwer accessor
This reduces the need to carry around a pointer to the repository as
well as the objects.
2014-05-25 09:12:10 +02:00
Carlos Martín Nieto 22bcd7decf Reference: expose Peel()
Peel a reference to a particular type of object, returning an Object,
which you then perform a type assertion on.
2014-05-23 11:37:00 +02:00
Jesse Ezell fc999289a2 Merge branch 'oid-parse-protection' into branch-iterator 2014-04-04 00:50:41 -07:00
Jesse Ezell 39f59d921b fix typo / return name iterator 2014-04-04 00:27:07 -07:00
Jesse Ezell b660db0a4b make it possible to handle errors 2014-04-02 10:31:48 -07:00
Jesse Ezell 5590078e6f remove channel based iteration for branch / ref. Add ReferenceNameIterator. All iterators use Next(). Remove interfaces. 2014-03-20 20:28:41 -07:00
Jesse Ezell 37b950bc90 various improvements to interface 2014-03-19 20:24:19 -07:00
Jesse Ezell 27bea93efe split out name iterator 2014-03-19 00:36:00 -07:00
Jesse Ezell 006286edb7 remove Branch struct, unify reference iterators 2014-03-19 00:19:02 -07:00
Jesse Ezell 5f01bd7abd add branch iterator / remove useless repo from reference iterator 2014-03-12 15:49:11 -07:00
Carlos Martín Nieto fc6d0fbfff Merge pull request #59 from libgit2/cmn/refs
Add a few reference utility functions
2014-02-27 17:03:39 +01:00
Carlos Martín Nieto c431fe3c2c Merge pull request #60 from libgit2/cmn/reflogs-default
Allow for a default in reflog messages
2014-02-27 17:03:20 +01:00
Carlos Martín Nieto 00ea11691b Convert the rest of the errors 2014-02-26 16:14:31 +01:00
Jesper Hansen 499f52a354 Added git error code to the error object. 2014-02-26 16:10:00 +01:00
Carlos Martín Nieto 2c8de242ee Allow for a default in reflog messages
We don't have a way to represent a NULL string, so if the user passes an
empty string, let's pass NULL down so we tell libgit2 to use the default.
2014-02-26 15:01:23 +01:00
Carlos Martín Nieto ca2c3c6db2 Add a few reference utility functions 2014-02-26 14:51:04 +01:00
Carlos Martín Nieto 8efcdd0e16 Merge pull request #55 from lye/add-is-x-reference-methods
Add Is$Type methods to Reference.
2014-02-23 15:43:02 +01:00
Carlos Martín Nieto 1b09b03c0e Merge commit 'refs/pull/53/head' of github.com:libgit2/git2go
On top: fix git_buf handling and rename signature

This fixes #57, #54.

Conflicts:
	git.go
	reference.go
	repository.go
	submodule.go
2014-02-23 15:31:22 +01:00
lye 53b5ecacbe Add Is$Type methods to Reference.
This patch adds the following methods to Reference:

	IsBranch() bool
	IsRemote() bool
	IsTag() bool

which correspond to the `git_reference_is_$type` functions in libgit2.
2014-02-20 00:28:31 -06:00
Aidan Nulman f66502aaf4 update git2go to support latest libgit2 development commit (id: 66af84) 2014-01-29 18:01:26 -05:00
Carlos Martín Nieto a40bdfd420 Lock the OS thread when acessing errors
The library stores error information in thread-local storage, which
means we need to make sure that the Go runtime doesn't switch OS
threads between the time we call a function and th time we attempt to
retrieve the error information.
2013-12-18 16:18:32 +01:00
Carlos Martín Nieto a5ad8de506 Don't repeat the pkg-config line
This is only needed once per package. Having it on every file makes the
build system ask about it n times, which is silly.
2013-11-14 00:23:04 +01:00
Vicent Martí 6c97b9ac9d Merge pull request #36 from libgit2/ref-iter
reference: get references out of the iterator
2013-09-17 08:03:50 -07:00
Carlos Martín Nieto b5aca803db Give each const group a type
This allows us to restrict which constants the compiler will allow
through, and makes the sorting in the documentation better.
2013-09-12 10:46:20 +02:00
Carlos Martín Nieto 00e3df94c7 Camel-case constants
Make the names look more like what you'd expect from Go.
2013-09-12 10:40:57 +02:00
Carlos Martín Nieto 4abda3a60b reference: get references out of the iterator
Allow getting references out of the iterator instead of just names.
2013-08-09 18:22:26 +02:00
Carlos Martín Nieto f5fc7e5f78 Reference: adjust to iterator changes
The Library's iterators now can return either the reference or the
reference's name. As the name is what we're set up for, rename the
functions appropriately so we compile against altest development.
2013-06-17 02:08:13 +02:00
Carlos Martín Nieto 931f187301 Implement a reference iterator
Wrap the reference iterators, and provide a Iter() function to get
them through a channel.
2013-05-23 11:13:42 +02:00
Carlos Martín Nieto 0b2f16665d Wrap immutable refs 2013-03-07 21:01:21 +01:00