rebase: fix int overflows on GIT_REBASE_NO_OPERATION #385

Closed
zchee wants to merge 1 commits from rebase-overflows_int into master
1 changed files with 3 additions and 3 deletions

View File

@ -155,9 +155,9 @@ func (rebase *Rebase) CurrentOperationIndex() (uint, error) {
runtime.LockOSThread() runtime.LockOSThread()
defer runtime.UnlockOSThread() defer runtime.UnlockOSThread()
operationIndex := int(C.git_rebase_operation_current(rebase.ptr)) operationIndex := uint(C.git_rebase_operation_current(rebase.ptr))
if operationIndex == C.GIT_REBASE_NO_OPERATION { if operationIndex == uint(C.GIT_REBASE_NO_OPERATION) {
return 0, MakeGitError(C.GIT_REBASE_NO_OPERATION) return 0, MakeGitError(C.int(operationIndex))
} }
return uint(operationIndex), nil return uint(operationIndex), nil