summaryrefslogtreecommitdiff
path: root/rebase.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2019-01-08 02:51:21 +0000
committerlhchavez <[email protected]>2019-01-08 02:51:21 +0000
commit6d67bde74a667dcdd060ef519832e8fd81064a8e (patch)
tree705e564b9dedf0ceced47e6f01012cb9fcb6322f /rebase.go
parent35518c78df9ae727651212512bfaa1a8dae02585 (diff)
parent2609f4c6f25a7da56e2e4960c250ea3dfb53e82b (diff)
Merge remote-tracking branch 'upstream/master' into repository-create_commit_from_ids
Diffstat (limited to 'rebase.go')
-rw-r--r--rebase.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/rebase.go b/rebase.go
index 5206fca..d29e183 100644
--- a/rebase.go
+++ b/rebase.go
@@ -6,6 +6,7 @@ package git
import "C"
import (
"errors"
+ "fmt"
"runtime"
"unsafe"
)
@@ -16,6 +17,8 @@ type RebaseOperationType uint
const (
// RebaseOperationPick The given commit is to be cherry-picked. The client should commit the changes and continue if there are no conflicts.
RebaseOperationPick RebaseOperationType = C.GIT_REBASE_OPERATION_PICK
+ // RebaseOperationReword The given commit is to be cherry-picked, but the client should prompt the user to provide an updated commit message.
+ RebaseOperationReword RebaseOperationType = C.GIT_REBASE_OPERATION_REWORD
// RebaseOperationEdit The given commit is to be cherry-picked, but the client should stop to allow the user to edit the changes before committing them.
RebaseOperationEdit RebaseOperationType = C.GIT_REBASE_OPERATION_EDIT
// RebaseOperationSquash The given commit is to be squashed into the previous commit. The commit message will be merged with the previous message.
@@ -26,6 +29,24 @@ const (
RebaseOperationExec RebaseOperationType = C.GIT_REBASE_OPERATION_EXEC
)
+func (t RebaseOperationType) String() string {
+ switch t {
+ case RebaseOperationPick:
+ return "pick"
+ case RebaseOperationReword:
+ return "reword"
+ case RebaseOperationEdit:
+ return "edit"
+ case RebaseOperationSquash:
+ return "squash"
+ case RebaseOperationFixup:
+ return "fixup"
+ case RebaseOperationExec:
+ return "exec"
+ }
+ return fmt.Sprintf("RebaseOperationType(%d)", t)
+}
+
// Special value indicating that there is no currently active operation
var RebaseNoOperation uint = ^uint(0)