Finish collects the information gained from processing the options and returns a `sizes.RefGrouper`.
()
| 255 | // Finish collects the information gained from processing the options |
| 256 | // and returns a `sizes.RefGrouper`. |
| 257 | func (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. |
no test coverage detected