DefaultRevertOptions initialises a RevertOptions struct with default values
()
| 44 | |
| 45 | // DefaultRevertOptions initialises a RevertOptions struct with default values |
| 46 | func 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 |
| 62 | func (r *Repository) Revert(commit *Commit, revertOptions *RevertOptions) error { |
searching dependent graphs…