Browse Source

Update vendoring

master
Dashie der otter 8 months ago
parent
commit
48953674c3
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
48 changed files with 108 additions and 58 deletions
  1. 5
    5
      Gopkg.lock
  2. 2
    2
      Gopkg.toml
  3. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/.gitmodules
  4. 2
    0
      vendor/gopkg.in/libgit2/git2go.v27/.travis.yml
  5. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/LICENSE
  6. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/Makefile
  7. 6
    6
      vendor/gopkg.in/libgit2/git2go.v27/README.md
  8. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/blame.go
  9. 5
    1
      vendor/gopkg.in/libgit2/git2go.v27/blob.go
  10. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/branch.go
  11. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/checkout.go
  12. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/cherrypick.go
  13. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/clone.go
  14. 32
    15
      vendor/gopkg.in/libgit2/git2go.v27/commit.go
  15. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/config.go
  16. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/credentials.go
  17. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/describe.go
  18. 2
    0
      vendor/gopkg.in/libgit2/git2go.v27/diff.go
  19. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/features.go
  20. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/git.go
  21. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go
  22. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/git_static.go
  23. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/graph.go
  24. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/handles.go
  25. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/ignore.go
  26. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/index.go
  27. 3
    0
      vendor/gopkg.in/libgit2/git2go.v27/merge.go
  28. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/note.go
  29. 5
    0
      vendor/gopkg.in/libgit2/git2go.v27/object.go
  30. 8
    2
      vendor/gopkg.in/libgit2/git2go.v27/odb.go
  31. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/packbuilder.go
  32. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/patch.go
  33. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/rebase.go
  34. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/refdb.go
  35. 3
    2
      vendor/gopkg.in/libgit2/git2go.v27/reference.go
  36. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/remote.go
  37. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/repository.go
  38. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/reset.go
  39. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/revparse.go
  40. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/settings.go
  41. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/signature.go
  42. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/stash.go
  43. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/status.go
  44. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/submodule.go
  45. 13
    10
      vendor/gopkg.in/libgit2/git2go.v27/tag.go
  46. 13
    6
      vendor/gopkg.in/libgit2/git2go.v27/tree.go
  47. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/walk.go
  48. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/wrapper.c

+ 5
- 5
Gopkg.lock View File

@@ -395,12 +395,12 @@
version = "v1.41.0"

[[projects]]
branch = "v26"
digest = "1:79a5003bce9bc94ea61fe4b7a88382b5f367585400122ed3feb5e483031834b6"
name = "gopkg.in/libgit2/git2go.v26"
branch = "v27"
digest = "1:6af8f24e29863581ecaa0900389a20c5b7cd13506fb83c317494a4f92253d6d5"
name = "gopkg.in/libgit2/git2go.v27"
packages = ["."]
pruneopts = "UT"
revision = "c9f7fd544d3991bd26c400b3c227673bcada42cc"
revision = "ecaeb7a21d479b7966311760a2e8bd734f8f0eef"

[[projects]]
digest = "1:3d43a1d68f315a1c4c2cd20ee4d35c96695f17637502366341ac43b7813ea95f"
@@ -441,7 +441,7 @@
"gopkg.in/clog.v1",
"gopkg.in/gomail.v2",
"gopkg.in/ini.v1",
"gopkg.in/libgit2/git2go.v26",
"gopkg.in/libgit2/git2go.v27",
"gopkg.in/macaron.v1",
]
solver-name = "gps-cdcl"

+ 2
- 2
Gopkg.toml View File

@@ -134,8 +134,8 @@
version = "1.41.0"

[[constraint]]
branch = "v26"
name = "gopkg.in/libgit2/git2go.v26"
branch = "v27"
name = "gopkg.in/libgit2/git2go.v27"

[[constraint]]
name = "gopkg.in/macaron.v1"

vendor/gopkg.in/libgit2/git2go.v26/.gitmodules → vendor/gopkg.in/libgit2/git2go.v27/.gitmodules View File


vendor/gopkg.in/libgit2/git2go.v26/.travis.yml → vendor/gopkg.in/libgit2/git2go.v27/.travis.yml View File

@@ -3,6 +3,8 @@ language: go
go:
- 1.7
- 1.8
- 1.9
- "1.10"
- tip

script: make test-static

vendor/gopkg.in/libgit2/git2go.v26/LICENSE → vendor/gopkg.in/libgit2/git2go.v27/LICENSE View File


vendor/gopkg.in/libgit2/git2go.v26/Makefile → vendor/gopkg.in/libgit2/git2go.v27/Makefile View File


vendor/gopkg.in/libgit2/git2go.v26/README.md → vendor/gopkg.in/libgit2/git2go.v27/README.md View File

@@ -35,9 +35,9 @@ If using `master` or building a branch statically, we need to build libgit2 firs
Run `go get -d github.com/libgit2/git2go` to download the code and go to your `$GOPATH/src/github.com/libgit2/git2go` directory. From there, we need to build the C code and put it into the resulting go binary.

git submodule update --init # get libgit2
make install
make install-static

will compile libgit2, link it into git2go and install it.
will compile libgit2, link it into git2go and install it. The `master` branch is set up to follow the specific libgit2 version that is vendored, so trying dynamic linking may or may not work depending on the exact versions involved.

Parallelism and network operations
----------------------------------
@@ -47,19 +47,19 @@ libgit2 may use OpenSSL and LibSSH2 for performing encrypted network connections
Running the tests
-----------------

For the stable version, `go test` will work as usual. For the `next` branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built
For the stable version, `go test` will work as usual. For the `master` branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built

make test
make test-static

Alternatively, you can build the library manually first and then run the tests

./script/build-libgit2-static.sh
go test -v
go test -v --tags "static" ./...

License
-------

M to the I to the T. See the LICENSE file if you've never seen a MIT license before.
M to the I to the T. See the LICENSE file if you've never seen an MIT license before.

Authors
-------

vendor/gopkg.in/libgit2/git2go.v26/blame.go → vendor/gopkg.in/libgit2/git2go.v27/blame.go View File


vendor/gopkg.in/libgit2/git2go.v26/blob.go → vendor/gopkg.in/libgit2/git2go.v27/blob.go View File

@@ -20,6 +20,10 @@ type Blob struct {
cast_ptr *C.git_blob
}

func (b *Blob) AsObject() *Object {
return &b.Object
}

func (v *Blob) Size() int64 {
ret := int64(C.git_blob_rawsize(v.cast_ptr))
runtime.KeepAlive(v)
@@ -44,7 +48,7 @@ func (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error) {
var size C.size_t

// Go 1.6 added some increased checking of passing pointer to
// C, but its check depends on its expectations of waht we
// C, but its check depends on its expectations of what we
// pass to the C function, so unless we take the address of
// its contents at the call site itself, it can fail when
// 'data' is a slice of a slice.

vendor/gopkg.in/libgit2/git2go.v26/branch.go → vendor/gopkg.in/libgit2/git2go.v27/branch.go View File


vendor/gopkg.in/libgit2/git2go.v26/checkout.go → vendor/gopkg.in/libgit2/git2go.v27/checkout.go View File


vendor/gopkg.in/libgit2/git2go.v26/cherrypick.go → vendor/gopkg.in/libgit2/git2go.v27/cherrypick.go View File


vendor/gopkg.in/libgit2/git2go.v26/clone.go → vendor/gopkg.in/libgit2/git2go.v27/clone.go View File


vendor/gopkg.in/libgit2/git2go.v26/commit.go → vendor/gopkg.in/libgit2/git2go.v27/commit.go View File

@@ -18,15 +18,23 @@ type Commit struct {
cast_ptr *C.git_commit
}

func (c Commit) Message() string {
return C.GoString(C.git_commit_message(c.cast_ptr))
func (c *Commit) AsObject() *Object {
return &c.Object
}

func (c Commit) RawMessage() string {
return C.GoString(C.git_commit_message_raw(c.cast_ptr))
func (c *Commit) Message() string {
ret := C.GoString(C.git_commit_message(c.cast_ptr))
runtime.KeepAlive(c)
return ret
}

func (c Commit) ExtractSignature() (string, string, error) {
func (c *Commit) RawMessage() string {
ret := C.GoString(C.git_commit_message_raw(c.cast_ptr))
runtime.KeepAlive(c)
return ret
}

func (c *Commit) ExtractSignature() (string, string, error) {

var c_signed C.git_buf
defer C.git_buf_free(&c_signed)
@@ -40,7 +48,7 @@ func (c Commit) ExtractSignature() (string, string, error) {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil)
runtime.KeepAlive(oid)
if ret < 0 {
return "", "", MakeGitError(ret)
} else {
@@ -49,17 +57,20 @@ func (c Commit) ExtractSignature() (string, string, error) {

}

func (c Commit) Summary() string {
return C.GoString(C.git_commit_summary(c.cast_ptr))
func (c *Commit) Summary() string {
ret := C.GoString(C.git_commit_summary(c.cast_ptr))
runtime.KeepAlive(c)
return ret
}

func (c Commit) Tree() (*Tree, error) {
func (c *Commit) Tree() (*Tree, error) {
var ptr *C.git_tree

runtime.LockOSThread()
defer runtime.UnlockOSThread()

err := C.git_commit_tree(&ptr, c.cast_ptr)
runtime.KeepAlive(c)
if err < 0 {
return nil, MakeGitError(err)
}
@@ -67,18 +78,24 @@ func (c Commit) Tree() (*Tree, error) {
return allocTree(ptr, c.repo), nil
}

func (c Commit) TreeId() *Oid {
return newOidFromC(C.git_commit_tree_id(c.cast_ptr))
func (c *Commit) TreeId() *Oid {
ret := newOidFromC(C.git_commit_tree_id(c.cast_ptr))
runtime.KeepAlive(c)
return ret
}

func (c Commit) Author() *Signature {
func (c *Commit) Author() *Signature {
cast_ptr := C.git_commit_author(c.cast_ptr)
return newSignatureFromC(cast_ptr)
ret := newSignatureFromC(cast_ptr)
runtime.KeepAlive(c)
return ret
}

func (c Commit) Committer() *Signature {
func (c *Commit) Committer() *Signature {
cast_ptr := C.git_commit_committer(c.cast_ptr)
return newSignatureFromC(cast_ptr)
ret := newSignatureFromC(cast_ptr)
runtime.KeepAlive(c)
return ret
}

func (c *Commit) Parent(n uint) *Commit {

vendor/gopkg.in/libgit2/git2go.v26/config.go → vendor/gopkg.in/libgit2/git2go.v27/config.go View File

@@ -77,7 +77,7 @@ func (c *Config) AddFile(path string, level ConfigLevel, force bool) error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()

ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), cbool(force))
ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force))
runtime.KeepAlive(c)
if ret < 0 {
return MakeGitError(ret)

vendor/gopkg.in/libgit2/git2go.v26/credentials.go → vendor/gopkg.in/libgit2/git2go.v27/credentials.go View File


vendor/gopkg.in/libgit2/git2go.v26/describe.go → vendor/gopkg.in/libgit2/git2go.v27/describe.go View File


vendor/gopkg.in/libgit2/git2go.v26/diff.go → vendor/gopkg.in/libgit2/git2go.v27/diff.go View File

@@ -437,6 +437,8 @@ const (
DiffShowUnmodified DiffOptionsFlag = C.GIT_DIFF_SHOW_UNMODIFIED
DiffPatience DiffOptionsFlag = C.GIT_DIFF_PATIENCE
DiffMinimal DiffOptionsFlag = C.GIT_DIFF_MINIMAL
DiffShowBinary DiffOptionsFlag = C.GIT_DIFF_SHOW_BINARY
DiffIndentHeuristic DiffOptionsFlag = C.GIT_DIFF_INDENT_HEURISTIC
)

type DiffNotifyCallback func(diffSoFar *Diff, deltaToAdd DiffDelta, matchedPathspec string) error

vendor/gopkg.in/libgit2/git2go.v26/features.go → vendor/gopkg.in/libgit2/git2go.v27/features.go View File


vendor/gopkg.in/libgit2/git2go.v26/git.go → vendor/gopkg.in/libgit2/git2go.v27/git.go View File


vendor/gopkg.in/libgit2/git2go.v26/git_dynamic.go → vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go View File

@@ -6,8 +6,8 @@ package git
#include <git2.h>
#cgo pkg-config: libgit2

#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 27
# error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
#endif

*/

vendor/gopkg.in/libgit2/git2go.v26/git_static.go → vendor/gopkg.in/libgit2/git2go.v27/git_static.go View File

@@ -9,8 +9,8 @@ package git
#cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
#include <git2.h>

#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 27
# error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
#endif

*/

vendor/gopkg.in/libgit2/git2go.v26/graph.go → vendor/gopkg.in/libgit2/git2go.v27/graph.go View File


vendor/gopkg.in/libgit2/git2go.v26/handles.go → vendor/gopkg.in/libgit2/git2go.v27/handles.go View File


vendor/gopkg.in/libgit2/git2go.v26/ignore.go → vendor/gopkg.in/libgit2/git2go.v27/ignore.go View File


vendor/gopkg.in/libgit2/git2go.v26/index.go → vendor/gopkg.in/libgit2/git2go.v27/index.go View File


vendor/gopkg.in/libgit2/git2go.v26/merge.go → vendor/gopkg.in/libgit2/git2go.v27/merge.go View File

@@ -355,6 +355,7 @@ type MergeFileOptions struct {
TheirLabel string
Favor MergeFileFavor
Flags MergeFileFlags
MarkerSize uint16
}

func mergeFileOptionsFromC(c C.git_merge_file_options) MergeFileOptions {
@@ -364,6 +365,7 @@ func mergeFileOptionsFromC(c C.git_merge_file_options) MergeFileOptions {
TheirLabel: C.GoString(c.their_label),
Favor: MergeFileFavor(c.favor),
Flags: MergeFileFlags(c.flags),
MarkerSize: uint16(c.marker_size),
}
}

@@ -373,6 +375,7 @@ func populateCMergeFileOptions(c *C.git_merge_file_options, options MergeFileOpt
c.their_label = C.CString(options.TheirLabel)
c.favor = C.git_merge_file_favor_t(options.Favor)
c.flags = C.git_merge_file_flag_t(options.Flags)
c.marker_size = C.ushort(options.MarkerSize)
}

func freeCMergeFileOptions(c *C.git_merge_file_options) {

vendor/gopkg.in/libgit2/git2go.v26/note.go → vendor/gopkg.in/libgit2/git2go.v27/note.go View File


vendor/gopkg.in/libgit2/git2go.v26/object.go → vendor/gopkg.in/libgit2/git2go.v27/object.go View File

@@ -26,6 +26,11 @@ type Object struct {
repo *Repository
}

// Objecter lets us accept any kind of Git object in functions.
type Objecter interface {
AsObject() *Object
}

func (t ObjectType) String() string {
switch t {
case ObjectAny:

vendor/gopkg.in/libgit2/git2go.v26/odb.go → vendor/gopkg.in/libgit2/git2go.v27/odb.go View File

@@ -182,17 +182,21 @@ func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error) {
// contents of the object.
func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error) {
stream := new(OdbReadStream)
var ctype C.git_otype
var csize C.size_t

runtime.LockOSThread()
defer runtime.UnlockOSThread()

ret := C.git_odb_open_rstream(&stream.ptr, v.ptr, id.toC())
ret := C.git_odb_open_rstream(&stream.ptr, &csize, &ctype, v.ptr, id.toC())
runtime.KeepAlive(v)
runtime.KeepAlive(id)
if ret < 0 {
return nil, MakeGitError(ret)
}

stream.Size = uint64(csize)
stream.Type = ObjectType(ctype)
runtime.SetFinalizer(stream, (*OdbReadStream).Free)
return stream, nil
}
@@ -264,7 +268,9 @@ func (object *OdbObject) Data() (data []byte) {
}

type OdbReadStream struct {
ptr *C.git_odb_stream
ptr *C.git_odb_stream
Size uint64
Type ObjectType
}

// Read reads from the stream

vendor/gopkg.in/libgit2/git2go.v26/packbuilder.go → vendor/gopkg.in/libgit2/git2go.v27/packbuilder.go View File


vendor/gopkg.in/libgit2/git2go.v26/patch.go → vendor/gopkg.in/libgit2/git2go.v27/patch.go View File

@@ -69,7 +69,7 @@ func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []
var patchPtr *C.git_patch

oldPtr := toPointer(oldBuf)
newPtr := (*C.char)(toPointer(newBuf))
newPtr := toPointer(newBuf)

cOldPath := C.CString(oldPath)
defer C.free(unsafe.Pointer(cOldPath))

vendor/gopkg.in/libgit2/git2go.v26/rebase.go → vendor/gopkg.in/libgit2/git2go.v27/rebase.go View File

@@ -30,7 +30,7 @@ const (
var RebaseNoOperation uint = ^uint(0)

// Error returned if there is no current rebase operation
var ErrRebaseNoOperation = errors.New("o current rebase operation")
var ErrRebaseNoOperation = errors.New("no current rebase operation")

// RebaseOperation describes a single instruction/operation to be performed during the rebase.
type RebaseOperation struct {

vendor/gopkg.in/libgit2/git2go.v26/refdb.go → vendor/gopkg.in/libgit2/git2go.v27/refdb.go View File


vendor/gopkg.in/libgit2/git2go.v26/reference.go → vendor/gopkg.in/libgit2/git2go.v27/reference.go View File

@@ -301,7 +301,7 @@ func (v *Reference) Owner() *Repository {
}
}

// Cmp compares both references, retursn 0 on equality, otherwise a
// Cmp compares v to ref2. It returns 0 on equality, otherwise a
// stable sorting.
func (v *Reference) Cmp(ref2 *Reference) int {
ret := int(C.git_reference_cmp(v.ptr, ref2.ptr))
@@ -310,13 +310,14 @@ func (v *Reference) Cmp(ref2 *Reference) int {
return ret
}

// Shorthand ret :=s a "human-readable" short reference name
// Shorthand returns a "human-readable" short reference name.
func (v *Reference) Shorthand() string {
ret := C.GoString(C.git_reference_shorthand(v.ptr))
runtime.KeepAlive(v)
return ret
}

// Name returns the full name of v.
func (v *Reference) Name() string {
ret := C.GoString(C.git_reference_name(v.ptr))
runtime.KeepAlive(v)

vendor/gopkg.in/libgit2/git2go.v26/remote.go → vendor/gopkg.in/libgit2/git2go.v27/remote.go View File


vendor/gopkg.in/libgit2/git2go.v26/repository.go → vendor/gopkg.in/libgit2/git2go.v27/repository.go View File

@@ -19,10 +19,10 @@ type Repository struct {
Remotes RemoteCollection
// Submodules represents the collection of submodules and can
// be used to add, remove and configure submodules in this
// repostiory.
// repository.
Submodules SubmoduleCollection
// References represents the collection of references and can
// be used to create, remove or update refernces for this repository.
// be used to create, remove or update references for this repository.
References ReferenceCollection
// Notes represents the collection of notes and can be used to
// read, write and delete notes from this repository.

vendor/gopkg.in/libgit2/git2go.v26/reset.go → vendor/gopkg.in/libgit2/git2go.v27/reset.go View File


vendor/gopkg.in/libgit2/git2go.v26/revparse.go → vendor/gopkg.in/libgit2/git2go.v27/revparse.go View File


vendor/gopkg.in/libgit2/git2go.v26/settings.go → vendor/gopkg.in/libgit2/git2go.v27/settings.go View File


vendor/gopkg.in/libgit2/git2go.v26/signature.go → vendor/gopkg.in/libgit2/git2go.v27/signature.go View File


vendor/gopkg.in/libgit2/git2go.v26/stash.go → vendor/gopkg.in/libgit2/git2go.v27/stash.go View File


vendor/gopkg.in/libgit2/git2go.v26/status.go → vendor/gopkg.in/libgit2/git2go.v27/status.go View File


vendor/gopkg.in/libgit2/git2go.v26/submodule.go → vendor/gopkg.in/libgit2/git2go.v27/submodule.go View File


vendor/gopkg.in/libgit2/git2go.v26/tag.go → vendor/gopkg.in/libgit2/git2go.v27/tag.go View File

@@ -17,6 +17,10 @@ type Tag struct {
cast_ptr *C.git_tag
}

func (t *Tag) AsObject() *Object {
return &t.Object
}

func (t Tag) Message() string {
ret := C.GoString(C.git_tag_message(t.cast_ptr))
runtime.KeepAlive(t)
@@ -63,8 +67,7 @@ type TagsCollection struct {
repo *Repository
}

func (c *TagsCollection) Create(
name string, commit *Commit, tagger *Signature, message string) (*Oid, error) {
func (c *TagsCollection) Create(name string, obj Objecter, tagger *Signature, message string) (*Oid, error) {

oid := new(Oid)

@@ -80,13 +83,13 @@ func (c *TagsCollection) Create(
}
defer C.git_signature_free(taggerSig)

ctarget := commit.ptr

runtime.LockOSThread()
defer runtime.UnlockOSThread()

ret := C.git_tag_create(oid.toC(), c.repo.ptr, cname, ctarget, taggerSig, cmessage, 0)
o := obj.AsObject()
ret := C.git_tag_create(oid.toC(), c.repo.ptr, cname, o.ptr, taggerSig, cmessage, 0)
runtime.KeepAlive(c)
runtime.KeepAlive(obj)
if ret < 0 {
return nil, MakeGitError(ret)
}
@@ -110,7 +113,7 @@ func (c *TagsCollection) Remove(name string) error {
return nil
}

// CreateLightweight creates a new lightweight tag pointing to a commit
// CreateLightweight creates a new lightweight tag pointing to an object
// and returns the id of the target object.
//
// The name of the tag is validated for consistency (see git_tag_create() for the rules
@@ -122,20 +125,20 @@ func (c *TagsCollection) Remove(name string) error {
// The created tag is a simple reference and can be queried using
// repo.References.Lookup("refs/tags/<name>"). The name of the tag (eg "v1.0.0")
// is queried with ref.Shorthand().
func (c *TagsCollection) CreateLightweight(name string, commit *Commit, force bool) (*Oid, error) {
func (c *TagsCollection) CreateLightweight(name string, obj Objecter, force bool) (*Oid, error) {

oid := new(Oid)

cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))

ctarget := commit.ptr

runtime.LockOSThread()
defer runtime.UnlockOSThread()

err := C.git_tag_create_lightweight(oid.toC(), c.repo.ptr, cname, ctarget, cbool(force))
o := obj.AsObject()
err := C.git_tag_create_lightweight(oid.toC(), c.repo.ptr, cname, o.ptr, cbool(force))
runtime.KeepAlive(c)
runtime.KeepAlive(obj)
if err < 0 {
return nil, MakeGitError(err)
}

vendor/gopkg.in/libgit2/git2go.v26/tree.go → vendor/gopkg.in/libgit2/git2go.v27/tree.go View File

@@ -27,6 +27,10 @@ type Tree struct {
cast_ptr *C.git_tree
}

func (t *Tree) AsObject() *Object {
return &t.Object
}

type TreeEntry struct {
Name string
Id *Oid
@@ -48,12 +52,13 @@ func (t Tree) EntryByName(filename string) *TreeEntry {
defer C.free(unsafe.Pointer(cname))

entry := C.git_tree_entry_byname(t.cast_ptr, cname)
runtime.KeepAlive(t)
if entry == nil {
return nil
}

return newTreeEntry(entry)
goEntry := newTreeEntry(entry)
runtime.KeepAlive(t)
return goEntry
}

// EntryById performs a lookup for a tree entry with the given SHA value.
@@ -67,13 +72,14 @@ func (t Tree) EntryById(id *Oid) *TreeEntry {
defer runtime.UnlockOSThread()

entry := C.git_tree_entry_byid(t.cast_ptr, id.toC())
runtime.KeepAlive(t)
runtime.KeepAlive(id)
if entry == nil {
return nil
}

return newTreeEntry(entry)
goEntry := newTreeEntry(entry)
runtime.KeepAlive(t)
return goEntry
}

// EntryByPath looks up an entry by its full path, recursing into
@@ -98,12 +104,13 @@ func (t Tree) EntryByPath(path string) (*TreeEntry, error) {

func (t Tree) EntryByIndex(index uint64) *TreeEntry {
entry := C.git_tree_entry_byindex(t.cast_ptr, C.size_t(index))
runtime.KeepAlive(t)
if entry == nil {
return nil
}

return newTreeEntry(entry)
goEntry := newTreeEntry(entry)
runtime.KeepAlive(t)
return goEntry
}

func (t Tree) EntryCount() uint64 {

vendor/gopkg.in/libgit2/git2go.v26/walk.go → vendor/gopkg.in/libgit2/git2go.v27/walk.go View File


vendor/gopkg.in/libgit2/git2go.v26/wrapper.c → vendor/gopkg.in/libgit2/git2go.v27/wrapper.c View File


Loading…
Cancel
Save