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

Function DefaultRevertOptions

revert.go:46–59  ·  view source on GitHub ↗

DefaultRevertOptions initialises a RevertOptions struct with default values

()

Source from the content-addressed store, hash-verified

44
45// DefaultRevertOptions initialises a RevertOptions struct with default values
46func DefaultRevertOptions() (RevertOptions, error) {
47 copts := C.git_revert_options{}
48
49 runtime.LockOSThread()
50 defer runtime.UnlockOSThread()
51
52 ecode := C.git_revert_options_init(&copts, C.GIT_REVERT_OPTIONS_VERSION)
53 if ecode < 0 {
54 return RevertOptions{}, MakeGitError(ecode)
55 }
56
57 defer freeRevertOptions(&copts)
58 return revertOptionsFromC(&copts), nil
59}
60
61// Revert the provided commit leaving the index updated with the results of the revert
62func (r *Repository) Revert(commit *Commit, revertOptions *RevertOptions) error {

Callers 2

TestRevertFunction · 0.85
TestRevertCommitFunction · 0.85

Calls 3

MakeGitErrorFunction · 0.85
freeRevertOptionsFunction · 0.85
revertOptionsFromCFunction · 0.85

Tested by 2

TestRevertFunction · 0.68
TestRevertCommitFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…