Compare commits
22 Commits
main
...
release-0.
Author | SHA1 | Date |
---|---|---|
|
c9f7fd544d | |
|
0231fb5a68 | |
|
ef5cc6bc29 | |
|
2d22de8d7e | |
|
4f0bb98c94 | |
|
d4a1519215 | |
|
1f712c6f96 | |
|
ca5ecbe9b7 | |
|
9ec9f647d4 | |
|
eb0bf21280 | |
|
30b904902b | |
|
1dedb84bde | |
|
f93b2433d5 | |
|
e424134bb6 | |
|
e0c6962c02 | |
|
22c1bf8e06 | |
|
450e168181 | |
|
d29ae45d5e | |
|
0ea4019bdc | |
|
76a60dfbeb | |
|
7c587b52cf | |
|
03c617ab62 |
|
@ -11,6 +11,12 @@ matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: tip
|
- go: tip
|
||||||
|
|
||||||
|
git:
|
||||||
|
submodules: false
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- git submodule update --init
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
43
commit.go
43
commit.go
|
@ -18,19 +18,15 @@ type Commit struct {
|
||||||
cast_ptr *C.git_commit
|
cast_ptr *C.git_commit
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) Message() string {
|
func (c Commit) Message() string {
|
||||||
ret := C.GoString(C.git_commit_message(c.cast_ptr))
|
return C.GoString(C.git_commit_message(c.cast_ptr))
|
||||||
runtime.KeepAlive(c)
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) RawMessage() string {
|
func (c Commit) RawMessage() string {
|
||||||
ret := C.GoString(C.git_commit_message_raw(c.cast_ptr))
|
return C.GoString(C.git_commit_message_raw(c.cast_ptr))
|
||||||
runtime.KeepAlive(c)
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) ExtractSignature() (string, string, error) {
|
func (c Commit) ExtractSignature() (string, string, error) {
|
||||||
|
|
||||||
var c_signed C.git_buf
|
var c_signed C.git_buf
|
||||||
defer C.git_buf_free(&c_signed)
|
defer C.git_buf_free(&c_signed)
|
||||||
|
@ -44,7 +40,7 @@ func (c *Commit) ExtractSignature() (string, string, error) {
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
defer runtime.UnlockOSThread()
|
defer runtime.UnlockOSThread()
|
||||||
ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil)
|
ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil)
|
||||||
runtime.KeepAlive(oid)
|
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return "", "", MakeGitError(ret)
|
return "", "", MakeGitError(ret)
|
||||||
} else {
|
} else {
|
||||||
|
@ -53,20 +49,17 @@ func (c *Commit) ExtractSignature() (string, string, error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) Summary() string {
|
func (c Commit) Summary() string {
|
||||||
ret := C.GoString(C.git_commit_summary(c.cast_ptr))
|
return 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
|
var ptr *C.git_tree
|
||||||
|
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
defer runtime.UnlockOSThread()
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
err := C.git_commit_tree(&ptr, c.cast_ptr)
|
err := C.git_commit_tree(&ptr, c.cast_ptr)
|
||||||
runtime.KeepAlive(c)
|
|
||||||
if err < 0 {
|
if err < 0 {
|
||||||
return nil, MakeGitError(err)
|
return nil, MakeGitError(err)
|
||||||
}
|
}
|
||||||
|
@ -74,24 +67,18 @@ func (c *Commit) Tree() (*Tree, error) {
|
||||||
return allocTree(ptr, c.repo), nil
|
return allocTree(ptr, c.repo), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) TreeId() *Oid {
|
func (c Commit) TreeId() *Oid {
|
||||||
ret := newOidFromC(C.git_commit_tree_id(c.cast_ptr))
|
return 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)
|
cast_ptr := C.git_commit_author(c.cast_ptr)
|
||||||
ret := newSignatureFromC(cast_ptr)
|
return 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)
|
cast_ptr := C.git_commit_committer(c.cast_ptr)
|
||||||
ret := newSignatureFromC(cast_ptr)
|
return newSignatureFromC(cast_ptr)
|
||||||
runtime.KeepAlive(c)
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) Parent(n uint) *Commit {
|
func (c *Commit) Parent(n uint) *Commit {
|
||||||
|
|
|
@ -6,8 +6,8 @@ package git
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
#cgo pkg-config: libgit2
|
#cgo pkg-config: libgit2
|
||||||
|
|
||||||
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 25
|
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
|
||||||
# error "Invalid libgit2 version; this git2go supports libgit2 v0.25"
|
# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,8 +9,8 @@ package git
|
||||||
#cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
|
#cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
|
|
||||||
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 25
|
#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
|
||||||
# error "Invalid libgit2 version; this git2go supports libgit2 v0.25"
|
# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,7 +15,6 @@ import (
|
||||||
type SubmoduleUpdateOptions struct {
|
type SubmoduleUpdateOptions struct {
|
||||||
*CheckoutOpts
|
*CheckoutOpts
|
||||||
*FetchOptions
|
*FetchOptions
|
||||||
CloneCheckoutStrategy CheckoutStrategy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submodule
|
// Submodule
|
||||||
|
@ -369,7 +368,6 @@ func populateSubmoduleUpdateOptions(ptr *C.git_submodule_update_options, opts *S
|
||||||
|
|
||||||
populateCheckoutOpts(&ptr.checkout_opts, opts.CheckoutOpts)
|
populateCheckoutOpts(&ptr.checkout_opts, opts.CheckoutOpts)
|
||||||
populateFetchOptions(&ptr.fetch_opts, opts.FetchOptions)
|
populateFetchOptions(&ptr.fetch_opts, opts.FetchOptions)
|
||||||
ptr.clone_checkout_strategy = C.uint(opts.CloneCheckoutStrategy)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit df4dfaadcf709646ebab2e57e3589952cf1ac809
|
Subproject commit 32dc763c116999240440b5054798208d97b4c562
|
Loading…
Reference in New Issue