Commit Graph

7 Commits

Author SHA1 Message Date
Carlos Martín Nieto a33875f9c5 Packbuilder: compilation fixes
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-17 01:55:36 +02:00
Vicent Martí 01d1a5c5d5 Merge pull request #24 from carlosmn/packbuilder-abort
Allow aborting the pack writing operation
2013-06-13 10:15:12 -07:00
Michael Crosby 6513377da0 Add nil for optional parameters for pack_write
The git_packbuilder_write function now takes
two optional arguments used for information
callbacks.  These are currently not needed
in the Go wrapper.
2013-06-07 19:08:10 -04:00
Carlos Martín Nieto b189d7919a Allow aborting the pack writing operation
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-23 11:44:06 +02:00
Axel Wagner 3a1bbbdf9d Correct some errors from 1da989e 2013-05-16 16:53:21 +02:00
Axel Wagner 1da989e28b Add Write(w io.Writer) to packbuilder
This wraps (*packbuilder).ForEach(), making it possible to write the
pack easiliy to a tcp-connection, a HTTP-Body or the like.
2013-05-16 14:02:22 +02:00
Axel Wagner 140f362428 Add support for git_packbuilder 2013-05-16 13:56:07 +02:00