From cc3ea8ac30d6214f4e8d00f87b7181c2b026196e Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Mon, 12 Jun 2017 00:52:35 +0900 Subject: [PATCH] rebase: fix int overflows on GIT_REBASE_NO_OPERATION Signed-off-by: Koichi Shiraishi --- rebase.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rebase.go b/rebase.go index 8553e25..9928f19 100644 --- a/rebase.go +++ b/rebase.go @@ -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