Esempio n. 1
0
func NewRevWalk(repo *Repo) (*RevWalk, error) {
	rev := new(RevWalk)
	if C.git_revwalk_new(&rev.git_revwalk, repo.git_repo) < GIT_SUCCESS {
		return nil, LastError()
	}
	return rev, nil
}
Esempio n. 2
0
func (repo *Repository) NewRevwalk() (*Revwalk, error) {
	revwalk := new(Revwalk)
	ecode := C.git_revwalk_new(&revwalk.git_revwalk, repo.git_repository)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return revwalk, nil
}
Esempio n. 3
0
func (v *Repository) Walk() (*RevWalk, error) {
	walk := new(RevWalk)
	ecode := C.git_revwalk_new(&walk.ptr, v.ptr)
	if ecode < 0 {
		return nil, LastError()
	}

	walk.repo = v
	runtime.SetFinalizer(walk, freeRevWalk)
	return walk, nil
}
Esempio n. 4
0
func (v *Repository) Walk() (*RevWalk, error) {

	var walkPtr *C.git_revwalk

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ecode := C.git_revwalk_new(&walkPtr, v.ptr)
	if ecode < 0 {
		return nil, MakeGitError(ecode)
	}

	return revWalkFromC(v, walkPtr), nil
}