summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorJesse Ezell <[email protected]>2014-03-20 21:56:41 -0700
committerJesse Ezell <[email protected]>2014-03-20 21:56:41 -0700
commitd0b334b24409ddc190a7010be0072d87df6b6bfe (patch)
treefb434c1f8182296b2a80bdf1939e09ddca021e68 /git.go
parent9acd67e388b6fccf982c9206dc5326ae35c13f49 (diff)
cleanup and refactor diff / patch
Diffstat (limited to 'git.go')
-rw-r--r--git.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/git.go b/git.go
index 28196c8..4c798b3 100644
--- a/git.go
+++ b/git.go
@@ -10,8 +10,8 @@ import (
"bytes"
"errors"
"runtime"
- "unsafe"
"strings"
+ "unsafe"
)
const (
@@ -22,6 +22,7 @@ const (
var (
ErrIterOver = errors.New("Iteration is over")
+ ErrInvalid = errors.New("Invalid state for operation")
)
func init() {
@@ -93,7 +94,7 @@ func (oid *Oid) Equal(oid2 *Oid) bool {
}
func (oid *Oid) IsZero() bool {
- for _, a := range(oid.bytes) {
+ for _, a := range oid.bytes {
if a != '0' {
return false
}
@@ -131,10 +132,10 @@ func ShortenOids(ids []*Oid, minlen int) (int, error) {
type GitError struct {
Message string
- Code int
+ Code int
}
-func (e GitError) Error() string{
+func (e GitError) Error() string {
return e.Message
}
@@ -147,14 +148,14 @@ func LastError() error {
}
func cbool(b bool) C.int {
- if (b) {
+ if b {
return C.int(1)
}
return C.int(0)
}
func ucbool(b bool) C.uint {
- if (b) {
+ if b {
return C.uint(1)
}
return C.uint(0)