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 84716e3..68712d4 100644
--- a/git.go
+++ b/git.go
@@ -26,6 +26,10 @@ type Oid struct {
}
func newOidFromC(coid *C.git_oid) *Oid {
+ if coid == nil {
+ return nil
+ }
+
oid := new(Oid)
copy(oid.bytes[0:20], C.GoBytes(unsafe.Pointer(coid), 20))
return oid