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

Function DefaultDescribeFormatOptions

describe.go:75–89  ·  view source on GitHub ↗

DefaultDescribeFormatOptions returns default options for formatting the output.

()

Source from the content-addressed store, hash-verified

73// DefaultDescribeFormatOptions returns default options for formatting
74// the output.
75func DefaultDescribeFormatOptions() (DescribeFormatOptions, error) {
76 runtime.LockOSThread()
77 defer runtime.UnlockOSThread()
78
79 opts := C.git_describe_format_options{}
80 ecode := C.git_describe_format_options_init(&opts, C.GIT_DESCRIBE_FORMAT_OPTIONS_VERSION)
81 if ecode < 0 {
82 return DescribeFormatOptions{}, MakeGitError(ecode)
83 }
84
85 return DescribeFormatOptions{
86 AbbreviatedSize: uint(opts.abbreviated_size),
87 AlwaysUseLongFormat: opts.always_use_long_format == 1,
88 }, nil
89}
90
91// DescribeOptionsStrategy behaves like the --tags and --all options
92// to git-describe, namely they say to look for any reference in

Callers 1

TestDescribeCommitFunction · 0.85

Calls 1

MakeGitErrorFunction · 0.85

Tested by 1

TestDescribeCommitFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…