| 92 | } |
| 93 | |
| 94 | func (r *Repository) RevparseExt(spec string) (*Object, *Reference, error) { |
| 95 | cspec := C.CString(spec) |
| 96 | defer C.free(unsafe.Pointer(cspec)) |
| 97 | |
| 98 | var obj *C.git_object |
| 99 | var ref *C.git_reference |
| 100 | |
| 101 | runtime.LockOSThread() |
| 102 | defer runtime.UnlockOSThread() |
| 103 | |
| 104 | ecode := C.git_revparse_ext(&obj, &ref, r.ptr, cspec) |
| 105 | if ecode != 0 { |
| 106 | return nil, nil, MakeGitError(ecode) |
| 107 | } |
| 108 | |
| 109 | if ref == nil { |
| 110 | return allocObject(obj, r), nil, nil |
| 111 | } |
| 112 | |
| 113 | return allocObject(obj, r), newReferenceFromC(ref, r), nil |
| 114 | } |