()
| 37 | } |
| 38 | |
| 39 | func (sig *Signature) toC() (*C.git_signature, error) { |
| 40 | if sig == nil { |
| 41 | return nil, nil |
| 42 | } |
| 43 | |
| 44 | var out *C.git_signature |
| 45 | |
| 46 | runtime.LockOSThread() |
| 47 | defer runtime.UnlockOSThread() |
| 48 | |
| 49 | name := C.CString(sig.Name) |
| 50 | defer C.free(unsafe.Pointer(name)) |
| 51 | |
| 52 | email := C.CString(sig.Email) |
| 53 | defer C.free(unsafe.Pointer(email)) |
| 54 | |
| 55 | ret := C.git_signature_new(&out, name, email, C.git_time_t(sig.When.Unix()), C.int(sig.Offset())) |
| 56 | if ret < 0 { |
| 57 | return nil, MakeGitError(ret) |
| 58 | } |
| 59 | |
| 60 | return out, nil |
| 61 | } |
| 62 | |
| 63 | func (repo *Repository) DefaultSignature() (*Signature, error) { |
| 64 | var out *C.git_signature |
nothing calls this directly
no test coverage detected