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

Method UpdateAll

index.go:266–300  ·  view source on GitHub ↗
(pathspecs []string, callback IndexMatchedPathCallback)

Source from the content-addressed store, hash-verified

264}
265
266func (v *Index) UpdateAll(pathspecs []string, callback IndexMatchedPathCallback) error {
267 cpathspecs := C.git_strarray{}
268 cpathspecs.count = C.size_t(len(pathspecs))
269 cpathspecs.strings = makeCStringsFromStrings(pathspecs)
270 defer freeStrarray(&cpathspecs)
271
272 var err error
273 data := indexMatchedPathCallbackData{
274 callback: callback,
275 errorTarget: &err,
276 }
277 runtime.LockOSThread()
278 defer runtime.UnlockOSThread()
279
280 var handle unsafe.Pointer
281 if callback != nil {
282 handle = pointerHandles.Track(&data)
283 defer pointerHandles.Untrack(handle)
284 }
285
286 ret := C._go_git_index_update_all(
287 v.ptr,
288 &cpathspecs,
289 handle,
290 )
291 runtime.KeepAlive(v)
292 if ret == C.int(ErrorCodeUser) && err != nil {
293 return err
294 }
295 if ret < 0 {
296 return MakeGitError(ret)
297 }
298
299 return nil
300}
301
302func (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) error {
303 cpathspecs := C.git_strarray{}

Callers

nothing calls this directly

Calls 5

makeCStringsFromStringsFunction · 0.85
freeStrarrayFunction · 0.85
MakeGitErrorFunction · 0.85
TrackMethod · 0.80
UntrackMethod · 0.80

Tested by

no test coverage detected