MCPcopy
hub / github.com/github/git-sizer / Finish

Method Finish

internal/refopts/ref_group_builder.go:257–279  ·  view source on GitHub ↗

Finish collects the information gained from processing the options and returns a `sizes.RefGrouper`.

()

Source from the content-addressed store, hash-verified

255// Finish collects the information gained from processing the options
256// and returns a `sizes.RefGrouper`.
257func (rgb *RefGroupBuilder) Finish() (sizes.RefGrouper, error) {
258 if rgb.topLevelGroup.filter == nil {
259 rgb.topLevelGroup.filter = git.AllReferencesFilter
260 }
261
262 refGrouper := refGrouper{
263 topLevelGroup: rgb.topLevelGroup,
264 }
265
266 if err := refGrouper.fillInTree(refGrouper.topLevelGroup); err != nil {
267 return nil, err
268 }
269
270 if refGrouper.topLevelGroup.filter != nil {
271 refGrouper.ignoredRefGroup = &sizes.RefGroup{
272 Symbol: "ignored",
273 Name: "Ignored",
274 }
275 refGrouper.refGroups = append(refGrouper.refGroups, *refGrouper.ignoredRefGroup)
276 }
277
278 return &refGrouper, nil
279}
280
281// refGrouper is a `sizes.RefGrouper` based on a hierarchy of nested
282// refgroups.

Callers 1

mainImplementationFunction · 0.95

Calls 1

fillInTreeMethod · 0.95

Tested by

no test coverage detected