summaryrefslogtreecommitdiff
path: root/tree.go
AgeCommit message (Collapse)Author
2021-09-30Allow skipping an entry expansion in `tree.Walk()` (#838)lhchavez
It is now possible to skip expanding an entry in `tree.Walk()` by returning `TreeWalkSkip`, in addition to stopping altogether by returning a non-nil error. Fixes: #837
2021-09-05The big Callback type adjustment of 2020lhchavez
This change makes all callbacks that can fail return an `error`. This makes things a lot more idiomatic.
2021-09-05Make all non-user-creatable structures non-comparable (#802)lhchavez
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.
2020-12-05Refactor all callbacks (#700)lhchavez
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-05Mark some symbols to be deprecated #minor (#698)lhchavez
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
2019-11-17Fixes #513 - Segfault during tree walkDinesh Bolkensteyn
2018-02-09tree: keep tree receiver alive as long as dependent entry is usedSteffen Prohaska
Signed-off-by: Steffen Prohaska <[email protected]>
2017-07-08Add Objecer interfaceCarlos Martín Nieto
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-08Third round of keep-alive aditionsCarlos Martín Nieto
2017-04-13Merge pull request #365 from AaronO/fix/memleak-tree-entrybynameCarlos Martín Nieto
Fix memleaks in Tree.EntryBy(Name/Path/Index), fixes #313
2017-02-25Remove unnecessary C.git_tree_entry_free calls ...Aaron O'Mullan
As per the docs, these entries belong to the tree and don’t need to be freed by the caller: * https://libgit2.github.com/libgit2/#HEAD/group/tree/git_tree_entry_bynam e
2017-02-24Fix memleaks in Tree.EntryBy(Name/Path/Index), fixes #313Aaron O'Mullan
2016-02-17Use Filemode in TreeBuilder.Insert, and add test coverage for someHan-Wen Nienhuys
TreeBuilder methods.
2015-08-04Move from an Object interface to a typeCarlos Martín Nieto
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-07-24Find tree entry by idCalin Seciu
Add support for 'git_tree_entry_byid'.
2015-05-22tree: use correct C callback signaturePatrick Steinhardt
2015-05-22handles: panic when we cannot retrieve handle dataPatrick Steinhardt
2015-05-22tree: use HandleList for C function callbacks.Patrick Steinhardt
2014-12-18Update libgit2David Calavera
Fix calls to C.git_treebuilder_create and C.git_treebuilder_write.
2014-12-11Remove useless includesCarlos Martín Nieto
2014-10-20Use Filemode type in TreeEntry and IndexEntryRyan Dahl
Fixes #121
2014-09-03Update clone options to be in sync with libgit2 master.David Calavera
Remove missing constants.
2014-04-01Adjust to Go tip changesCarlos Martín Nieto
It does not like breaking aliasing rules, so let's keep a casted pointer for when libgit2 wants that.
2014-03-07add blob chunk creation, creation of tree builders for specific trees, minor ↵Jesse Ezell
API cleanup
2014-02-26Convert the rest of the errorsCarlos Martín Nieto
2014-02-26Added git error code to the error object.Jesper Hansen
2013-12-18Lock the OS thread when acessing errorsCarlos Martín Nieto
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-09-12Give each const group a typeCarlos Martín Nieto
This allows us to restrict which constants the compiler will allow through, and makes the sorting in the documentation better.
2013-09-12Tree: add EntryByPathCarlos Martín Nieto
The more powerful version of EntryByName.
2013-09-09Add Filemode to TreeEntryCarlos Martín Nieto
This field was missing, so let's add it, and let's add the const definitions for the modes while we're here.
2013-04-26Use ObjectType in TreeEntryAxel Wagner
2013-04-18Ok, now with shared base objectVicent Marti
2013-04-16Take 2 on polymorphismVicent Marti
2013-03-08TreeEntry: use Id instead of OidCarlos Martín Nieto
Name it like The Library and the rest of the bindings.
2013-03-06Free Git objects via finalizers or manuallyCarlos Martín Nieto
Provide a manual way of freeing objects, but set finalizers for them in case the user does not want to worry about memory management, which would be useful for commits or trees, which sare typically small. When the objects are freed manually, the finalizer is unset to avoid double-freeing, mimicking what the go runtime does.
2013-03-05Initial commitVicent Marti