(pathspecs []string, callback IndexMatchedPathCallback)
| 264 | } |
| 265 | |
| 266 | func (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 | |
| 302 | func (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) error { |
| 303 | cpathspecs := C.git_strarray{} |
nothing calls this directly
no test coverage detected