DefaultDescribeFormatOptions returns default options for formatting the output.
()
| 73 | // DefaultDescribeFormatOptions returns default options for formatting |
| 74 | // the output. |
| 75 | func 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 |
searching dependent graphs…