summaryrefslogtreecommitdiff
path: root/remote.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2015-03-15 01:49:32 +0100
committerCarlos Martín Nieto <[email protected]>2015-03-15 01:49:32 +0100
commitc4fce1a218fd33938c0be90e939531c0a00ebf7f (patch)
tree40cf7f6c0331050db5f841ddfd6738951f482f66 /remote.go
parent050e6fbc49ac1a173af5e3462b3c2d330cadd113 (diff)
Update to libgit2 d675982a153
There's been some changes to the checkout strategy, especially the SAFE_CREATE mode, which is now the RECREATE_MISSING flag, though that shouldn't be necessary to use in the general case. The largest changes come from the removal of the signture from ref-modifying functions/methods and the removal of the reflog string in all but those directly related to moving references.
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go38
1 files changed, 6 insertions, 32 deletions
diff --git a/remote.go b/remote.go
index 84750d3..72d3934 100644
--- a/remote.go
+++ b/remote.go
@@ -598,18 +598,9 @@ func (o *Remote) UpdateFetchHead() bool {
// Fetch performs a fetch operation. refspecs specifies which refspecs
// to use for this fetch, use an empty list to use the refspecs from
-// the configuration; sig and msg specify what to use for the reflog
-// entries. Leave nil and "" to use defaults.
-func (o *Remote) Fetch(refspecs []string, sig *Signature, msg string) error {
-
- var csig *C.git_signature = nil
- if sig != nil {
- csig, err := sig.toC()
- if err != nil {
- return err
- }
- defer C.free(unsafe.Pointer(csig))
- }
+// the configuration; msg specifies what to use for the reflog
+// entries. Leave "" to use defaults.
+func (o *Remote) Fetch(refspecs []string, msg string) error {
var cmsg *C.char = nil
if msg != "" {
@@ -625,7 +616,7 @@ func (o *Remote) Fetch(refspecs []string, sig *Signature, msg string) error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
- ret := C.git_remote_fetch(o.ptr, &crefspecs, csig, cmsg)
+ ret := C.git_remote_fetch(o.ptr, &crefspecs, cmsg)
if ret < 0 {
return MakeGitError(ret)
}
@@ -696,24 +687,7 @@ func (o *Remote) Ls(filterRefs ...string) ([]RemoteHead, error) {
return heads, nil
}
-func (o *Remote) Push(refspecs []string, opts *PushOptions, sig *Signature, msg string) error {
- var csig *C.git_signature = nil
- if sig != nil {
- csig, err := sig.toC()
- if err != nil {
- return err
- }
- defer C.free(unsafe.Pointer(csig))
- }
-
- var cmsg *C.char
- if msg == "" {
- cmsg = nil
- } else {
- cmsg = C.CString(msg)
- defer C.free(unsafe.Pointer(cmsg))
- }
-
+func (o *Remote) Push(refspecs []string, opts *PushOptions) error {
var copts C.git_push_options
C.git_push_init_options(&copts, C.GIT_PUSH_OPTIONS_VERSION)
if opts != nil {
@@ -728,7 +702,7 @@ func (o *Remote) Push(refspecs []string, opts *PushOptions, sig *Signature, msg
runtime.LockOSThread()
defer runtime.UnlockOSThread()
- ret := C.git_remote_push(o.ptr, &crefspecs, &copts, csig, cmsg)
+ ret := C.git_remote_push(o.ptr, &crefspecs, &copts)
if ret < 0 {
return MakeGitError(ret)
}