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

Method AddByPath

index.go:191–205  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

189}
190
191func (v *Index) AddByPath(path string) error {
192 cstr := C.CString(path)
193 defer C.free(unsafe.Pointer(cstr))
194
195 runtime.LockOSThread()
196 defer runtime.UnlockOSThread()
197
198 ret := C.git_index_add_bypath(v.ptr, cstr)
199 runtime.KeepAlive(v)
200 if ret < 0 {
201 return MakeGitError(ret)
202 }
203
204 return nil
205}
206
207// AddFromBuffer adds or replaces an index entry from a buffer in memory
208func (v *Index) AddFromBuffer(entry *IndexEntry, buffer []byte) error {

Callers 10

TestCreateCommitBufferFunction · 0.80
TestCreateCommitFromIdsFunction · 0.80
TestRepositorySetConfigFunction · 0.80
prepareStashRepoFunction · 0.80
seedTestRepoOptFunction · 0.80
updateReadmeFunction · 0.80
addAndGetTreeFunction · 0.80
TestReferenceIteratorFunction · 0.80
TestCreateRepoAndStageFunction · 0.80
appendCommitFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 10

TestCreateCommitBufferFunction · 0.64
TestCreateCommitFromIdsFunction · 0.64
TestRepositorySetConfigFunction · 0.64
prepareStashRepoFunction · 0.64
seedTestRepoOptFunction · 0.64
updateReadmeFunction · 0.64
addAndGetTreeFunction · 0.64
TestReferenceIteratorFunction · 0.64
TestCreateRepoAndStageFunction · 0.64
appendCommitFunction · 0.64