| Age | Commit message (Collapse) | Author |
|
When marshalling diff callback data to Go structs, any `char*` need to
be pre-emptively copied onto Go's heap as they're invalidated as soon as
our callback function returns. This patch adds this extra copy before
sending the value to the channel, which fixes a bug wherein
`DiffLine.Content`, `DiffFile.Path` and `DiffHunk.Header` would
previously return garbage data.
|
|
It is possible that the typed enums from libgit2 should be exported as
distinct types rather than numeric constants (e.g, `git_delta_t` and
`git_line_t` should be typed), but this has not been done in this patch.
|
|
This commit adds barebones capacity to generate diffs from two trees and
to emit those as git-style diffs (via `Patch.String`), or to enumerate
the files/hunks/lines in the diff to emit the data yourself.
The walk functions have been implemented in the same manner as the Odb
walking methods.
Note that not all of the functionality is implemented for either the
`git_diff_*` nor the `git_patch_*` functions, and there are unexposed
constants which would likely be useful to add.
|
|
Lock the OS thread when acessing errors
|
|
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.
|
|
Fix memleak, TreeBuilder, Config and Parent commit
|
|
|
|
|
|
|
|
This is only needed once per package. Having it on every file makes the
build system ask about it n times, which is silly.
|
|
|
|
|
|
reference: get references out of the iterator
|
|
Wrap the odb streams
|
|
Goify consts
|
|
This allows us to restrict which constants the compiler will allow
through, and makes the sorting in the documentation better.
|
|
Make the names look more like what you'd expect from Go.
|
|
The more powerful version of EntryByName.
|
|
Define the object type values as constants
|
|
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.
|
|
This field was missing, so let's add it, and let's add the const
definitions for the modes while we're here.
|
|
Allow getting references out of the iterator instead of just names.
|
|
|
|
The Library's iterators now can return either the reference or the
reference's name. As the name is what we're set up for, rename the
functions appropriately so we compile against altest development.
|
|
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.
|
|
My take on polymorphism
|
|
Allow aborting the pack writing operation
|
|
Catch nil error instances
|
|
Implement a reference iterator
|
|
Add nil for optional arguments to git_packbuilder_write
|
|
Implement Parent()-functions for Commits
|
|
Implement ShortenOids
|
|
Implement git_odb_foreach
|
|
The git_packbuilder_write function now takes
two optional arguments used for information
callbacks. These are currently not needed
in the Go wrapper.
|
|
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.
|
|
Wrap the reference iterators, and provide a Iter() function to get
them through a channel.
|
|
|
|
|
|
|
|
Unfortunately libgit2 sometimes returns an error without setting an
error message. Provide an alternative message instead of trying to
dereference nil.
|
|
Use cbool-helper in Discover()
|
|
Implement git_repository_discover
|
|
|
|
Use ObjectType in TreeEntry
|
|
Implement Packbuilder-Support
|
|
|
|
This wraps (*packbuilder).ForEach(), making it possible to write the
pack easiliy to a tcp-connection, a HTTP-Body or the like.
|
|
|
|
|
|
Implement most of the oid_-functions as Methods
|