NewRefGroupBuilder creates and returns a `RefGroupBuilder` instance.
(configger Configger)
| 25 | // NewRefGroupBuilder creates and returns a `RefGroupBuilder` |
| 26 | // instance. |
| 27 | func NewRefGroupBuilder(configger Configger) (*RefGroupBuilder, error) { |
| 28 | tlg := refGroup{ |
| 29 | RefGroup: sizes.RefGroup{ |
| 30 | Symbol: "", |
| 31 | Name: "Refs to walk", |
| 32 | }, |
| 33 | } |
| 34 | |
| 35 | rgb := RefGroupBuilder{ |
| 36 | topLevelGroup: &tlg, |
| 37 | groups: map[sizes.RefGroupSymbol]*refGroup{ |
| 38 | "": &tlg, |
| 39 | }, |
| 40 | } |
| 41 | |
| 42 | rgb.initializeStandardRefgroups() |
| 43 | if err := rgb.readRefgroupsFromGitconfig(configger); err != nil { |
| 44 | return nil, err |
| 45 | } |
| 46 | |
| 47 | return &rgb, nil |
| 48 | } |
| 49 | |
| 50 | // getGroup returns the `refGroup` for the symbol with the specified |
| 51 | // name, first creating it (and any missing parents) if needed. |
no test coverage detected