(format DiffStatsFormat, width uint)
| 263 | ) |
| 264 | |
| 265 | func (stats *DiffStats) String(format DiffStatsFormat, |
| 266 | width uint) (string, error) { |
| 267 | buf := C.git_buf{} |
| 268 | defer C.git_buf_dispose(&buf) |
| 269 | |
| 270 | runtime.LockOSThread() |
| 271 | defer runtime.UnlockOSThread() |
| 272 | |
| 273 | ret := C.git_diff_stats_to_buf(&buf, |
| 274 | stats.ptr, C.git_diff_stats_format_t(format), C.size_t(width)) |
| 275 | runtime.KeepAlive(stats) |
| 276 | if ret < 0 { |
| 277 | return "", MakeGitError(ret) |
| 278 | } |
| 279 | |
| 280 | return C.GoString(buf.ptr), nil |
| 281 | } |
| 282 | |
| 283 | func (diff *Diff) Stats() (*DiffStats, error) { |
| 284 | stats := new(DiffStats) |
nothing calls this directly
no test coverage detected