summaryrefslogtreecommitdiff
path: root/odb.go
AgeCommit message (Collapse)Author
2021-09-05Add support for Odb.MultiPackIndex() (#819)lhchavez
This change exposes the binding for `git_odb_write_multi_pack_index()`.
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-10More callback refactoring (#713)lhchavez
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.
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-02-23Add odb.NewOdbBackendLoose()lhchavez
This change adds support for odb.NewOdbBackendLoose(). This, together with the git.Packbuilder, can do what Mempack does with a lot less memory.
2020-02-23Add support for indexers and alternate odb packfileslhchavez
This allows for implementations of git servers written in Go.
2019-12-10Adjust to libgit2 changesCarlos Martín Nieto
2019-02-11Uprev vendored libgit2 to v0.28lhchavez
New version is here!
2019-01-05Use git_object_t instead of deprecated git_otypeCarlos Martín Nieto
2019-01-03Merge pull request #447 from walkenzoy/masterCarlos Martín Nieto
git2go: small fixes to odb module
2018-12-28Return io.EOF on OdbReadStream.Read()lhchavez
This change makes OdbReadStream.Read() comply with the usual io.Reader semantics.
2018-07-03git2go: small fixes to odb moduleMichel Lespinasse
- Fix couple cgo issues in odb.Write() and odb.Hash(). This is the same issue - and same solution - as repo.CreateBlobFromBuffer() used to have. - Add test for odb.Read()
2018-02-22Adjust to the change in the git_odb_open_rstream signatureCarlos Martín Nieto
2017-07-08Third round of keep-alive aditionsCarlos Martín Nieto
2017-01-20Merge remote-tracking branch 'origin/next'Carlos Martín Nieto
2016-09-30odb & refdb: make New*BackendFromC take unsafe.Pointer as argument allowing ↵Mark Karpeles
argument to be set from different package
2016-07-19odb: Expose git_odb_object_type() as OdbObject.Type()Kirill Smelkov
It might be needed when one is writing `git cat-file --batch` equivalent which has output format <sha1> SP <type> SP <size> LF <contents> LF
2016-02-16odb: don't copy bufferIan Lance Taylor
2016-02-16Merge remote-tracking branch 'upstream/master'Ian Lance Taylor
2016-02-03Expose git_odb_read_header as Odb.ReadHeader.Han-Wen Nienhuys
This function is much faster for discovering sizes for a given OID.
2016-01-07handles, merge, odb: changes for Go 1.6 pointer passing rulesIan Lance Taylor
See http://tip.golang.org/cmd/cgo/#hdr-Passing_pointers .
2015-11-02odb: remove debug fmt.PrintlnsAugie Fackler
These appear to be left over debug statements, and they also look like they were intended to be fmt.Printf calls anyway.
2015-06-08Update to libgit2 b6011e29Carlos Martín Nieto
2015-05-22odb: use HandleList for C function callbacks.Patrick Steinhardt
2015-03-04go fmtMark Probst
2014-12-11Remove useless includesCarlos Martín Nieto
2014-12-06Add the newer missing thread-locking instancesCarlos Martín Nieto
2014-12-06Add missing thread lockingCarlos Martín Nieto
2014-05-06Odb: use a callback instead of a channel for ForEachCarlos Martín Nieto
A channel provides no way to specify whether we stopped sending data because of an error or because there is no more data. Therefore, make Odb.ForEach() take a callback with which the user is free to do whatever they need, letting us return en error.
2014-04-03update for upstream changesAidan Nulman
2014-04-03Merge branch 'master' into custom_odbAidan Nulman
Conflicts: odb.go wrapper.c
2014-04-03explicit returnsAidan Nulman
2014-02-26Convert the rest of the errorsCarlos Martín Nieto
2014-02-26Added git error code to the error object.Jesper Hansen
2014-02-24Merge branch 'master' into custom_odbAidan Nulman
Conflicts: git.go reference.go repository.go submodule.go
2014-01-29add OdbBackend.Free() and the C it wraps; go fmt odb.goAidan Nulman
2014-01-28Merge branch 'master' into custom_odbAidan Nulman
2014-01-26Remove unnecessary cast.Claudiu-Vlad Ursache
2014-01-25Add Odb hash function.Claudiu-Vlad Ursache
2013-12-20remove unnecessary commentAidan Nulman
2013-12-20Add OdbBackend constructorAidan Nulman
2013-12-19Rename constructor functions to New...Aidan Nulman
2013-12-19Refactor InitRepositoryWCustomOdbBackend() into component functionsAidan Nulman
2013-12-18Stop assuming ODB backend includes wrapping routine; wrap in git2go insteadAidan Nulman
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-09-17Merge pull request #38 from libgit2/odb-streamVicent Martí
Wrap the odb streams
2013-09-11Object types are constantsCarlos Martín Nieto
Define the object type values as constants
2013-09-11Wrap the odb streamsCarlos Martín Nieto
The interface to these streams should be what you expect from Go, and both have Write and Close functions so they implement Reader/ReadCloser and Write/WriteCloser respectively.
2013-06-13Merge pull request #13 from libgit2/polymorphism-take-2Vicent Martí
My take on polymorphism