Checkout callbacks #321
|
@ -96,6 +96,9 @@ func (opts *CheckoutOpts) toC() *C.git_checkout_options {
|
||||||
|
|
||||||
//export checkoutNotifyCallback
|
//export checkoutNotifyCallback
|
||||||
func checkoutNotifyCallback(why C.git_checkout_notify_t, cpath *C.char, cbaseline, ctarget, cworkdir, data unsafe.Pointer) int {
|
func checkoutNotifyCallback(why C.git_checkout_notify_t, cpath *C.char, cbaseline, ctarget, cworkdir, data unsafe.Pointer) int {
|
||||||
|
if data == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
path := C.GoString(cpath)
|
path := C.GoString(cpath)
|
||||||
var baseline, target, workdir DiffFile
|
var baseline, target, workdir DiffFile
|
||||||
if cbaseline != nil {
|
if cbaseline != nil {
|
||||||
|
@ -116,6 +119,9 @@ func checkoutNotifyCallback(why C.git_checkout_notify_t, cpath *C.char, cbaselin
|
||||||
|
|
||||||
//export checkoutProgressCallback
|
//export checkoutProgressCallback
|
||||||
func checkoutProgressCallback(path *C.char, completed_steps, total_steps C.size_t, data unsafe.Pointer) int {
|
func checkoutProgressCallback(path *C.char, completed_steps, total_steps C.size_t, data unsafe.Pointer) int {
|
||||||
|
if data == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
opts := pointerHandles.Get(data).(CheckoutOpts)
|
opts := pointerHandles.Get(data).(CheckoutOpts)
|
||||||
if opts.ProgressCallback == nil {
|
if opts.ProgressCallback == nil {
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue