summaryrefslogtreecommitdiff
path: root/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/commit.go b/commit.go
index 498669e..0edebb6 100644
--- a/commit.go
+++ b/commit.go
@@ -31,7 +31,7 @@ func (c Commit) Tree() (*Tree, error) {
err := C.git_commit_tree(&ptr, c.ptr)
if err < 0 {
- return nil, LastError()
+ return nil, MakeGitError(err)
}
return allocObject(ptr).(*Tree), nil
@@ -94,6 +94,11 @@ func (v *Signature) Offset() int {
}
func (sig *Signature) toC() *C.git_signature {
+
+ if sig == nil {
+ return nil
+ }
+
var out *C.git_signature
name := C.CString(sig.Name)