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

Method AddConflict

index.go:528–564  ·  view source on GitHub ↗
(ancestor *IndexEntry, our *IndexEntry, their *IndexEntry)

Source from the content-addressed store, hash-verified

526}
527
528func (v *Index) AddConflict(ancestor *IndexEntry, our *IndexEntry, their *IndexEntry) error {
529
530 var cancestor *C.git_index_entry
531 var cour *C.git_index_entry
532 var ctheir *C.git_index_entry
533
534 if ancestor != nil {
535 cancestor = &C.git_index_entry{}
536 populateCIndexEntry(ancestor, cancestor)
537 defer freeCIndexEntry(cancestor)
538 }
539
540 if our != nil {
541 cour = &C.git_index_entry{}
542 populateCIndexEntry(our, cour)
543 defer freeCIndexEntry(cour)
544 }
545
546 if their != nil {
547 ctheir = &C.git_index_entry{}
548 populateCIndexEntry(their, ctheir)
549 defer freeCIndexEntry(ctheir)
550 }
551
552 runtime.LockOSThread()
553 defer runtime.UnlockOSThread()
554
555 ecode := C.git_index_conflict_add(v.ptr, cancestor, cour, ctheir)
556 runtime.KeepAlive(v)
557 runtime.KeepAlive(ancestor)
558 runtime.KeepAlive(our)
559 runtime.KeepAlive(their)
560 if ecode < 0 {
561 return MakeGitError(ecode)
562 }
563 return nil
564}
565
566type IndexConflict struct {
567 Ancestor *IndexEntry

Callers

nothing calls this directly

Calls 3

populateCIndexEntryFunction · 0.85
freeCIndexEntryFunction · 0.85
MakeGitErrorFunction · 0.85

Tested by

no test coverage detected