From e1f09497409bb8dea59d8312f1049267cee37544 Mon Sep 17 00:00:00 2001 From: ezwiebel Date: Sun, 7 Aug 2016 17:00:14 +1000 Subject: Add Abort() service to wrapper --- rebase.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rebase.go') diff --git a/rebase.go b/rebase.go index fb3d612..ee409df 100644 --- a/rebase.go +++ b/rebase.go @@ -50,6 +50,15 @@ type Rebase struct { ptr *C.git_rebase } +// Abort aborts a rebase that is currently in progress, resetting the repository and working directory to their state before rebase began. +func (rebase *Rebase) Abort() error { + err := C.git_rebase_abort(rebase.ptr) + if err < 0 { + return MakeGitError(err) + } + return nil +} + //RebaseInit initializes a rebase operation to rebase the changes in branch relative to upstream onto another branch. func (r *Repository) RebaseInit(branch *AnnotatedCommit, upstream *AnnotatedCommit, onto *AnnotatedCommit, opts *RebaseOptions) (*Rebase, error) { runtime.LockOSThread() @@ -158,7 +167,6 @@ func newRebaseFromC(ptr *C.git_rebase) *Rebase { /* TODO -- Add last wrapper services and manage rebase_options -int git_rebase_abort(git_rebase *rebase); int git_rebase_init_options(git_rebase_options *opts, unsigned int version); int git_rebase_open(git_rebase **out, git_repository *repo, const git_rebase_options *opts); git_rebase_operation * git_rebase_operation_byindex(git_rebase *rebase, size_t idx); -- cgit v1.2.3