Uprev vendored libgit2 to v0.28

New version is here!
This commit is contained in:
lhchavez 2019-01-12 21:21:20 +00:00
parent 2f91268f74
commit 5fda6dd901
4 changed files with 12 additions and 12 deletions

View File

@ -8,8 +8,8 @@ package git
#cgo !windows pkg-config: --static ${SRCDIR}/static-build/install/lib/pkgconfig/libgit2.pc #cgo !windows pkg-config: --static ${SRCDIR}/static-build/install/lib/pkgconfig/libgit2.pc
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 27 #if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 28
# error "Invalid libgit2 version; this git2go supports libgit2 v0.27" # error "Invalid libgit2 version; this git2go supports libgit2 v0.28"
#endif #endif
*/ */

View File

@ -13,12 +13,12 @@ import (
type ObjectType int type ObjectType int
const ( const (
ObjectAny ObjectType = C.GIT_OBJECT_ANY ObjectAny ObjectType = C.GIT_OBJECT_ANY
ObjectBad ObjectType = C.GIT_OBJECT_BAD ObjectInvalid ObjectType = C.GIT_OBJECT_INVALID
ObjectCommit ObjectType = C.GIT_OBJECT_COMMIT ObjectCommit ObjectType = C.GIT_OBJECT_COMMIT
ObjectTree ObjectType = C.GIT_OBJECT_TREE ObjectTree ObjectType = C.GIT_OBJECT_TREE
ObjectBlob ObjectType = C.GIT_OBJECT_BLOB ObjectBlob ObjectType = C.GIT_OBJECT_BLOB
ObjectTag ObjectType = C.GIT_OBJECT_TAG ObjectTag ObjectType = C.GIT_OBJECT_TAG
) )
type Object struct { type Object struct {
@ -35,8 +35,8 @@ func (t ObjectType) String() string {
switch t { switch t {
case ObjectAny: case ObjectAny:
return "Any" return "Any"
case ObjectBad: case ObjectInvalid:
return "Bad" return "Invalid"
case ObjectCommit: case ObjectCommit:
return "Commit" return "Commit"
case ObjectTree: case ObjectTree:

2
odb.go
View File

@ -66,7 +66,7 @@ func (v *Odb) ReadHeader(oid *Oid) (uint64, ObjectType, error) {
ret := C.git_odb_read_header(&sz, &cotype, v.ptr, oid.toC()) ret := C.git_odb_read_header(&sz, &cotype, v.ptr, oid.toC())
runtime.KeepAlive(v) runtime.KeepAlive(v)
if ret < 0 { if ret < 0 {
return 0, ObjectBad, MakeGitError(ret) return 0, ObjectInvalid, MakeGitError(ret)
} }
return uint64(sz), ObjectType(cotype), nil return uint64(sz), ObjectType(cotype), nil

2
vendor/libgit2 vendored

@ -1 +1 @@
Subproject commit fba70a9d5f1fa433968a3dfd51e3153c8eebe834 Subproject commit 1a107fac0fc88a4d74b64ffc9ae2fd178ba631c0