summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'git.go')
-rw-r--r--git.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/git.go b/git.go
index fdc640a..387d81e 100644
--- a/git.go
+++ b/git.go
@@ -10,6 +10,7 @@ import (
"bytes"
"unsafe"
"strings"
+ "fmt"
)
const (
@@ -107,6 +108,9 @@ func (e GitError) Error() string{
func LastError() error {
err := C.giterr_last()
+ if err == nil {
+ return &GitError{"No message", 0}
+ }
return &GitError{C.GoString(err.message), int(err.klass)}
}