diff options
| author | ezwiebel <[email protected]> | 2016-11-23 17:10:59 +1100 |
|---|---|---|
| committer | ezwiebel <[email protected]> | 2016-11-23 17:10:59 +1100 |
| commit | 6118c9ba37f494cbb892aa686416280ae6ee6593 (patch) | |
| tree | 9d4ea7a3edc3f6e11dab1aa585fd25e34c68fe89 /rebase.go | |
| parent | a671e67ee884c0c69b6216ac0bff01dfde4dd622 (diff) | |
LockOSThread in CurrentOperationIndex for git error creation
Diffstat (limited to 'rebase.go')
| -rw-r--r-- | rebase.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -145,16 +145,21 @@ func (r *Repository) OpenRebase(opts *RebaseOptions) (*Rebase, error) { // OperationAt gets the rebase operation specified by the given index. func (rebase *Rebase) OperationAt(index uint) *RebaseOperation { operation := C.git_rebase_operation_byindex(rebase.ptr, C.size_t(index)) + return newRebaseOperationFromC(operation) } // CurrentOperationIndex gets the index of the rebase operation that is currently being applied. // Returns an error if no rebase operation is currently applied. func (rebase *Rebase) CurrentOperationIndex() (uint, error) { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + operationIndex := int(C.git_rebase_operation_current(rebase.ptr)) if operationIndex == C.GIT_REBASE_NO_OPERATION { return 0, MakeGitError(C.GIT_REBASE_NO_OPERATION) } + return uint(operationIndex), nil } |
