Beispiel #1
0
func (repo *Repository) StatusFile(path string) (StatusFlag, error) {
	var cflags C.uint
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ecode := C.git_status_file(&cflags, repo.git_repository, cpath)
	if ecode != git_SUCCESS {
		return StatusFlag(cflags), gitError()
	}
	return StatusFlag(cflags), nil
}
Beispiel #2
0
func (v *Repository) StatusFile(path string) (Status, error) {
	var statusFlags C.uint
	cPath := C.CString(path)
	defer C.free(unsafe.Pointer(cPath))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_status_file(&statusFlags, v.ptr, cPath)
	if ret < 0 {
		return 0, MakeGitError(ret)
	}
	return Status(statusFlags), nil
}