From b98b0e764066066fd9a5224468c15b50f6627fa9 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sat, 8 Jul 2017 20:58:08 +0200 Subject: rebase: correct the return values for CurrentOperationIndex We were incorectly reporting `C.GIT_REBASE_NO_OPERATION` as an error code when it is none. We should instead return it as the value. The compiler doesn't seem to actually look at the sizes so instead we must recreate the value ourselves with `^uint(0)`. The error return is kept for API compatibility but should go away eventually. --- rebase_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rebase_test.go') diff --git a/rebase_test.go b/rebase_test.go index fb88a4e..ef4f920 100644 --- a/rebase_test.go +++ b/rebase_test.go @@ -182,7 +182,7 @@ func performRebaseOnto(repo *Repository, branch string) (*Rebase, error) { // Check no operation has been started yet rebaseOperationIndex, err := rebase.CurrentOperationIndex() - if err == nil { + if rebaseOperationIndex != RebaseNoOperation && err != ErrRebaseNoOperation { return nil, errors.New("No operation should have been started yet") } -- cgit v1.2.3