summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <[email protected]>2018-01-21 13:46:54 -0800
committerJosh Bleecher Snyder <[email protected]>2018-01-21 13:48:51 -0800
commit9b850d084e13e0376f3fe8cfb556d2e7b51f398f (patch)
treeff8c1c3c5768d4a611be3fa5d9702429814c83c7
parent21fd4ad5f6ee67580fcf831917e54e18b074b5ed (diff)
rebase: make RebaseOperationType a fmt.Stringer
Helps with debugging.
-rw-r--r--rebase.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/rebase.go b/rebase.go
index 4517dde..d29e183 100644
--- a/rebase.go
+++ b/rebase.go
@@ -6,6 +6,7 @@ package git
import "C"
import (
"errors"
+ "fmt"
"runtime"
"unsafe"
)
@@ -28,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)