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

Function DefaultApplyOptions

diff.go:962–974  ·  view source on GitHub ↗

DefaultApplyOptions returns default options for applying diffs or patches.

()

Source from the content-addressed store, hash-verified

960
961// DefaultApplyOptions returns default options for applying diffs or patches.
962func DefaultApplyOptions() (*ApplyOptions, error) {
963 opts := C.git_apply_options{}
964
965 runtime.LockOSThread()
966 defer runtime.UnlockOSThread()
967
968 ecode := C.git_apply_options_init(&opts, C.GIT_APPLY_OPTIONS_VERSION)
969 if int(ecode) != 0 {
970 return nil, MakeGitError(ecode)
971 }
972
973 return applyOptionsFromC(&opts), nil
974}
975
976func populateApplyOptions(copts *C.git_apply_options, opts *ApplyOptions, errorTarget *error) *C.git_apply_options {
977 C.git_apply_options_init(copts, C.GIT_APPLY_OPTIONS_VERSION)

Callers 2

TestApplyDiffAddfileFunction · 0.85
TestApplyToTreeFunction · 0.85

Calls 2

MakeGitErrorFunction · 0.85
applyOptionsFromCFunction · 0.85

Tested by 2

TestApplyDiffAddfileFunction · 0.68
TestApplyToTreeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…