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

Method Conflict

index.go:572–595  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

570}
571
572func (v *Index) Conflict(path string) (IndexConflict, error) {
573
574 var cancestor *C.git_index_entry
575 var cour *C.git_index_entry
576 var ctheir *C.git_index_entry
577
578 cpath := C.CString(path)
579 defer C.free(unsafe.Pointer(cpath))
580
581 runtime.LockOSThread()
582 defer runtime.UnlockOSThread()
583
584 ecode := C.git_index_conflict_get(&cancestor, &cour, &ctheir, v.ptr, cpath)
585 if ecode < 0 {
586 return IndexConflict{}, MakeGitError(ecode)
587 }
588 ret := IndexConflict{
589 Ancestor: newIndexEntryFromC(cancestor),
590 Our: newIndexEntryFromC(cour),
591 Their: newIndexEntryFromC(ctheir),
592 }
593 runtime.KeepAlive(v)
594 return ret, nil
595}
596
597// deprecated: You should use `Index.Conflict()` instead.
598func (v *Index) GetConflict(path string) (IndexConflict, error) {

Callers 3

GetConflictMethod · 0.95

Calls 3

MakeGitErrorFunction · 0.85
newIndexEntryFromCFunction · 0.85
freeMethod · 0.80

Tested by 2