diff options
| author | Jesse Ezell <[email protected]> | 2014-03-21 22:16:26 -0700 |
|---|---|---|
| committer | Jesse Ezell <[email protected]> | 2014-03-21 22:51:38 -0700 |
| commit | 155f641683f09ec1a9511f42867ae3f278a6800b (patch) | |
| tree | 75720dd634dd7b045a47c296bc401b292965e863 /patch.go | |
| parent | f85c38ce22391ef8a932673dabf82219527ab433 (diff) | |
don't expose 3 different diff foreach methods. use structures instead of pointers to structures for diff detail. add patch error code handling. trim excess data from diff structures.
Diffstat (limited to 'patch.go')
| -rw-r--r-- | patch.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 } |
