Add RebaseOperationReword, and make RebaseOperationType a stringer #420

Merged
josharian merged 2 commits from rebase-operation-type-stringer into master 2019-01-05 05:05:44 -06:00
1 changed files with 19 additions and 0 deletions
Showing only changes of commit 9b850d084e - Show all commits

View File

@ -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)