summaryrefslogtreecommitdiff
path: root/patch.go
diff options
context:
space:
mode:
Diffstat (limited to 'patch.go')
-rw-r--r--patch.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/patch.go b/patch.go
index f2016c4..880f088 100644
--- a/patch.go
+++ b/patch.go
@@ -35,10 +35,10 @@ func (patch *Patch) Free() error {
}
func (patch *Patch) String() (string, error) {
- if diff.ptr != nil {
+ if patch.ptr == nil {
return "", ErrInvalid
}
- var cptr *C.char
- C.git_patch_to_str(&cptr, patch.ptr)
- return C.GoString(cptr), nil
+ var buf C.git_buf
+ C.git_patch_to_buf(&buf, patch.ptr)
+ return C.GoString(buf.ptr), nil
}