diff options
| author | lhchavez <[email protected]> | 2020-02-23 13:53:17 +0000 |
|---|---|---|
| committer | lhchavez <[email protected]> | 2020-02-23 13:53:17 +0000 |
| commit | c20008416a64e2ae884a14332b258160a261a5df (patch) | |
| tree | 58ae95d9f007937876eed1aac89b0518a034e442 /rebase.go | |
| parent | 79fe156d307a9c7b294aa92c741dc0c2759a1894 (diff) | |
| parent | 4bca045e5aa98b0b791fb467705de0692fe3514f (diff) | |
Merge remote-tracking branch 'upstream/master' into git_index_add_frombuffer
Diffstat (limited to 'rebase.go')
| -rw-r--r-- | rebase.go | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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,11 +29,29 @@ 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) // Error returned if there is no current rebase operation -var ErrRebaseNoOperation = errors.New("o current rebase operation") +var ErrRebaseNoOperation = errors.New("no current rebase operation") // RebaseOperation describes a single instruction/operation to be performed during the rebase. type RebaseOperation struct { |
