summaryrefslogtreecommitdiff
path: root/rebase.go
diff options
context:
space:
mode:
authorezwiebel <[email protected]>2016-08-07 17:00:14 +1000
committerezwiebel <[email protected]>2016-08-07 17:48:18 +1000
commite1f09497409bb8dea59d8312f1049267cee37544 (patch)
tree3a8dc420fe01b8d9fce0543b5a5217cdd8089599 /rebase.go
parenta62a8c3b92eeb14055d30608ac7d3243bcfba701 (diff)
Add Abort() service to wrapper
Diffstat (limited to 'rebase.go')
-rw-r--r--rebase.go10
1 files changed, 9 insertions, 1 deletions
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);