MCPcopy Create free account
hub / github.com/libgit2/git2go / String

Method String

diff.go:265–281  ·  view source on GitHub ↗
(format DiffStatsFormat,
	width uint)

Source from the content-addressed store, hash-verified

263)
264
265func (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
283func (diff *Diff) Stats() (*DiffStats, error) {
284 stats := new(DiffStats)

Callers

nothing calls this directly

Calls 1

MakeGitErrorFunction · 0.85

Tested by

no test coverage detected