Add support for CreateCommitFromIds #466
Loading…
Reference in New Issue
No description provided.
Delete Branch "repository-create_commit_from_ids"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change adds support for CreateCommitFromIds from libgit2.
It looks like this should be
C.calloc
. Should we be using sizeof on*C.git_oid
rather than a generic pointer?Can we avoid this pointer arithmetic? Can we generate the array in Go and pass that pointer to
C.git_commit_create_from_ids
?IIRC this was a workaround for the dreaded cgo argument has Go pointer to Go pointer. admittedly, i didn't invest too much time trying more options, so let me give it another try.
worst case scenario, i'll add a comment.
I chose malloc since i was writing to the entire array, but
C.calloc
looks a bit cleaner.Tried different things, but now I'm pretty sure we cannot avoid this :( added a comment.
It's more about the overflow protection, though unlikely to be an issue here. It also indicates to readers that we are dealing with arrays.
It looks like you accidentally commited a change to the libgit2 submodule.
@ -392,2 +460,4 @@
}
func (v *Odb) Free() {
runtime.SetFinalizer(v, nil)
We also need to keep
tree
alive.@ -392,2 +460,4 @@
}
func (v *Odb) Free() {
runtime.SetFinalizer(v, nil)
Done