@@ -6,6 +6,7 @@ package git
6
6
import "C"
7
7
import (
8
8
"errors"
9
+ "fmt"
9
10
"runtime"
10
11
"unsafe"
11
12
)
@@ -16,6 +17,8 @@ type RebaseOperationType uint
16
17
const (
17
18
// RebaseOperationPick The given commit is to be cherry-picked. The client should commit the changes and continue if there are no conflicts.
18
19
RebaseOperationPick RebaseOperationType = C .GIT_REBASE_OPERATION_PICK
20
+ // RebaseOperationReword The given commit is to be cherry-picked, but the client should prompt the user to provide an updated commit message.
21
+ RebaseOperationReword RebaseOperationType = C .GIT_REBASE_OPERATION_REWORD
19
22
// 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.
20
23
RebaseOperationEdit RebaseOperationType = C .GIT_REBASE_OPERATION_EDIT
21
24
// 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 (
26
29
RebaseOperationExec RebaseOperationType = C .GIT_REBASE_OPERATION_EXEC
27
30
)
28
31
32
+ func (t RebaseOperationType ) String () string {
33
+ switch t {
34
+ case RebaseOperationPick :
35
+ return "pick"
36
+ case RebaseOperationReword :
37
+ return "reword"
38
+ case RebaseOperationEdit :
39
+ return "edit"
40
+ case RebaseOperationSquash :
41
+ return "squash"
42
+ case RebaseOperationFixup :
43
+ return "fixup"
44
+ case RebaseOperationExec :
45
+ return "exec"
46
+ }
47
+ return fmt .Sprintf ("RebaseOperationType(%d)" , t )
48
+ }
49
+
29
50
// Special value indicating that there is no currently active operation
30
51
var RebaseNoOperation uint = ^ uint (0 )
31
52
0 commit comments