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

Function newMergeFileResultFromC

merge.go:436–455  ·  view source on GitHub ↗
(c *C.git_merge_file_result)

Source from the content-addressed store, hash-verified

434}
435
436func newMergeFileResultFromC(c *C.git_merge_file_result) *MergeFileResult {
437 var path string
438 if c.path != nil {
439 path = C.GoString(c.path)
440 }
441
442 originalBytes := C.GoBytes(unsafe.Pointer(c.ptr), C.int(c.len))
443 gobytes := make([]byte, len(originalBytes))
444 copy(gobytes, originalBytes)
445 r := &MergeFileResult{
446 Automergeable: c.automergeable != 0,
447 Path: path,
448 Mode: uint(c.mode),
449 Contents: gobytes,
450 ptr: c,
451 }
452
453 runtime.SetFinalizer(r, (*MergeFileResult).Free)
454 return r
455}
456
457func (r *MergeFileResult) Free() {
458 runtime.SetFinalizer(r, nil)

Callers 1

MergeFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…