diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-07-01 16:00:17 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-07-01 16:00:17 +0200 |
| commit | 4eae20ec279d20948aa5a45e0963ae7c4bcb0712 (patch) | |
| tree | 63cf04f7caf30d60fb495b81b1c474c44b606431 /repository.go | |
| parent | 84275e691fc7657f0f353979a89043758b38c556 (diff) | |
Adjust style
Diffstat (limited to 'repository.go')
| -rw-r--r-- | repository.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/repository.go b/repository.go index c271ea6..996e966 100644 --- a/repository.go +++ b/repository.go @@ -260,13 +260,11 @@ func (v *Repository) IsHeadDetached() (bool, error) { defer runtime.UnlockOSThread() ret := C.git_repository_head_detached(v.ptr) - switch ret { - case 1: - return true, nil - case 0: - return false, nil + if ret < 0 { + return false, MakeGitError(ret) } - return false, MakeGitError(ret) + + return ret != 0, nil } func (v *Repository) CreateReference(name string, id *Oid, force bool, sig *Signature, msg string) (*Reference, error) { |
