summaryrefslogtreecommitdiff
path: root/patch.go
diff options
context:
space:
mode:
Diffstat (limited to 'patch.go')
-rw-r--r--patch.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/patch.go b/patch.go
index d927109..0665501 100644
--- a/patch.go
+++ b/patch.go
@@ -40,6 +40,9 @@ func (patch *Patch) String() (string, error) {
return "", ErrInvalid
}
var buf C.git_buf
- C.git_patch_to_buf(&buf, patch.ptr)
+ ecode := C.git_patch_to_buf(&buf, patch.ptr)
+ if ecode < 0 {
+ return "", MakeGitError(ecode)
+ }
return C.GoString(buf.ptr), nil
}