rebase: fix int overflows on GIT_REBASE_NO_OPERATION

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
This commit is contained in:
Koichi Shiraishi 2017-06-12 00:52:35 +09:00
parent daee43b891
commit cc3ea8ac30
No known key found for this signature in database
GPG Key ID: A71DFD3B4DA7A79B
1 changed files with 3 additions and 3 deletions

View File

@ -155,9 +155,9 @@ 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)
operationIndex := uint(C.git_rebase_operation_current(rebase.ptr))
if operationIndex == uint(C.GIT_REBASE_NO_OPERATION) {
return 0, MakeGitError(C.int(operationIndex))
}
return uint(operationIndex), nil