summaryrefslogtreecommitdiff
path: root/packbuilder.go
AgeCommit message (Collapse)Author
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`.
2018-11-15Add support for Packbuilder.InsertFromWalk()lhchavez
This change adds support for Packbuilder.InsertFromWalk() from libgit2.
2017-07-08Third round of keep-alive aditionsCarlos Martín Nieto
2015-05-22packbuilder: use HandleList for C function callbacks.Patrick Steinhardt
2015-03-04go fmtMark Probst
2014-12-11Remove useless includesCarlos Martín Nieto
2014-12-06Add missing thread lockingCarlos Martín Nieto
2014-05-06Packbuilder: use a callback for ForEach instead of a channelCarlos Martín Nieto
Channels provide no means to report an error. Closing a channel could mean anything. This is particularly important when dealing with IO, which we do quite often in the pack builder. Use ForEach which returns an error instead.
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-11-14Don't repeat the pkg-config lineCarlos Martín Nieto
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-13Packbuilder: adjust to changes in devCarlos Martín Nieto
2013-06-17Packbuilder: compilation fixesCarlos Martín Nieto
Don't name the return values, as they conflict with the names we want inside and the types don't match what we want to have inside. We need them to be two-way channels in the function, and then pass unidirectional references to the different functions.
2013-06-13Merge pull request #24 from carlosmn/packbuilder-abortVicent Martí
Allow aborting the pack writing operation
2013-06-07Add nil for optional parameters for pack_writeMichael Crosby
The git_packbuilder_write function now takes two optional arguments used for information callbacks. These are currently not needed in the Go wrapper.
2013-05-23Allow aborting the pack writing operationCarlos Martín Nieto
In case of an error in the writer, the packbuilder will stay around waiting for someone to read from its channel. The state associated with a packbuilder is non-trivial and it will keep a reference to the object, so the GC won't be able to free it. Change the ForEach interface to also return a "stop" channel. Closing the channel or writing into it will cause the first receive clause to act, making the callback to return -1, aborting the operation and ending the goroutine, freeing its hold on the packbuilder.
2013-05-16Correct some errors from 1da989eAxel Wagner
2013-05-16Add Write(w io.Writer) to packbuilderAxel Wagner
This wraps (*packbuilder).ForEach(), making it possible to write the pack easiliy to a tcp-connection, a HTTP-Body or the like.
2013-05-16Add support for git_packbuilderAxel Wagner