Uprev libgit2

This uprevs libgit2 to the latest and greatest. Notably,

* Fixes the interface of `git_mempack_reset`, since it now returns an
  `int` instead of being `void`.

Fixes: #533
This commit is contained in:
lhchavez 2020-02-13 03:06:01 +00:00
parent f21ecd9e74
commit 419bac9075
2 changed files with 11 additions and 4 deletions

View File

@ -6,7 +6,7 @@ package git
extern int git_mempack_new(git_odb_backend **out); extern int git_mempack_new(git_odb_backend **out);
extern int git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_backend *backend); extern int git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_backend *backend);
extern void git_mempack_reset(git_odb_backend *backend); extern int git_mempack_reset(git_odb_backend *backend);
extern void _go_git_odb_backend_free(git_odb_backend *backend); extern void _go_git_odb_backend_free(git_odb_backend *backend);
*/ */
import "C" import "C"
@ -79,6 +79,13 @@ func (mempack *Mempack) Dump(repository *Repository) ([]byte, error) {
// //
// This assumes that Mempack.Dump has been called before to store all the // This assumes that Mempack.Dump has been called before to store all the
// queued objects into a single packfile. // queued objects into a single packfile.
func (mempack *Mempack) Reset() { func (mempack *Mempack) Reset() error {
C.git_mempack_reset(mempack.ptr) runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_mempack_reset(mempack.ptr)
if ret < 0 {
return MakeGitError(ret)
}
return nil
} }

2
vendor/libgit2 vendored

@ -1 +1 @@
Subproject commit 6777db8e8343014d57c41b335e0c60af44d4e9f2 Subproject commit ee3307a183e39d602b25fa94831c6fc09e7c1b61