MCPcopy Create free account
hub / github.com/libgit2/git2go / SetWorkdir

Method SetWorkdir

repository.go:699–712  ·  view source on GitHub ↗
(workdir string, updateGitlink bool)

Source from the content-addressed store, hash-verified

697}
698
699func (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error {
700 cstr := C.CString(workdir)
701 defer C.free(unsafe.Pointer(cstr))
702
703 runtime.LockOSThread()
704 defer runtime.UnlockOSThread()
705
706 if ret := C.git_repository_set_workdir(repo.ptr, cstr, cbool(updateGitlink)); ret < 0 {
707 return MakeGitError(ret)
708 }
709 runtime.KeepAlive(repo)
710
711 return nil
712}
713
714func (v *Repository) TreeBuilder() (*TreeBuilder, error) {
715 bld := new(TreeBuilder)

Callers

nothing calls this directly

Calls 3

cboolFunction · 0.85
MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected