Commit Graph

14 Commits

Author SHA1 Message Date
Carlos Martín Nieto fc1230ba16
Merge pull request #447 from walkenzoy/master
git2go: small fixes to odb module
2019-01-03 16:22:15 +01:00
lhchavez ab3470030b Add some tests
This should prevent regressions in the future.
2018-12-28 04:42:09 +00:00
Michel Lespinasse bdca40d275 git2go: small fixes to odb module
- 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-07-03 16:43:07 -07:00
Carlos Martín Nieto e55c00eca7 Run the tests in parallel
This saves about 1s, or 1/3 of the test runtime. The linking is still
much slower, but this we can control.
2016-08-27 19:21:05 +02:00
Han-Wen Nienhuys 773ac24a16 Expose git_odb_read_header as Odb.ReadHeader.
This function is much faster for discovering sizes for a given OID.
2016-02-03 15:56:39 +01:00
Carlos Martín Nieto 36e0a256fe Update to libgit2 b6011e29 2015-06-08 04:11:21 +02:00
Patrick Steinhardt e919653755 odb: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt e300945a3d tests: always clean up temporary repository dirs
Some test repositories are not correctly removed after the tests
did run. Fix by introducing a function that is to be used for
cleaning up temporary test repositories.
2015-04-24 13:01:51 +02:00
Mark Probst 45d88ca5f4 go fmt 2015-03-04 15:52:59 -08:00
Carlos Martín Nieto 2594f3f889 Odb: use a callback instead of a channel for ForEach
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-05-06 14:19:34 +02:00
Carlos Martín Nieto c9c7c1e779 Oid: make NewOid take a string
This is the most common way of having an id that's not in Oid form, so
let's make it the "default" and rename to NewOidFromBytes() the one that
takes []byte.
2014-03-19 03:56:50 +01:00
Claudiu-Vlad Ursache 53f2ebce5f Test for Odb hash function. 2014-01-25 22:18:43 +01:00
Carlos Martín Nieto f583ad8abd Remove leftover reference to old const 2013-09-22 00:05:37 +02:00
Carlos Martín Nieto 621397026c Wrap the odb streams
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-09-11 19:25:40 +02:00