예제 #1
0
파일: patch.go 프로젝트: joshi4/shortbread
func (patch *Patch) String() (string, error) {
	if patch.ptr == nil {
		return "", ErrInvalid
	}
	var buf C.git_buf
	ecode := C.git_patch_to_buf(&buf, patch.ptr)
	if ecode < 0 {
		return "", MakeGitError(ecode)
	}
	return C.GoString(buf.ptr), nil
}
예제 #2
0
파일: patch.go 프로젝트: wid/git2go
func (patch *Patch) String() (string, error) {
	if patch.ptr == nil {
		return "", ErrInvalid
	}
	var buf C.git_buf

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ecode := C.git_patch_to_buf(&buf, patch.ptr)
	if ecode < 0 {
		return "", MakeGitError(ecode)
	}
	return C.GoString(buf.ptr), nil
}