Skip to content

Commit be2362a

Browse files
committed
Repository.GetConfig(): rename method from Config()
This should help prevent confusion with the name of the `Config` type itself.
1 parent cb83101 commit be2362a

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

git/gitconfig.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ type Config struct {
1818
Entries []ConfigEntry
1919
}
2020

21-
// Config returns the entries from gitconfig. If `prefix` is provided,
22-
// then only include entries in that section, which must match the at
23-
// a component boundary (as defined by `configKeyMatchesPrefix()`),
24-
// and strip off the prefix in the keys that are returned.
25-
func (repo *Repository) Config(prefix string) (*Config, error) {
21+
// GetConfig returns the entries from gitconfig. If `prefix` is
22+
// provided, then only include entries in that section, which must
23+
// match the at a component boundary (as defined by
24+
// `configKeyMatchesPrefix()`), and strip off the prefix in the keys
25+
// that are returned.
26+
func (repo *Repository) GetConfig(prefix string) (*Config, error) {
2627
cmd := repo.gitCommand("config", "--list", "-z")
2728

2829
out, err := cmd.Output()

internal/refopts/ref_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (rg *refGroup) collectSymbols(refname string) (bool, []sizes.RefGroupSymbol
7878
// gitconfig and returns the result. It is not considered an error if
7979
// there are no usable config entries for the filter.
8080
func (rg *refGroup) augmentFromConfig(configger Configger) error {
81-
config, err := configger.Config(fmt.Sprintf("refgroup.%s", rg.Symbol))
81+
config, err := configger.GetConfig(fmt.Sprintf("refgroup.%s", rg.Symbol))
8282
if err != nil {
8383
return err
8484
}

internal/refopts/ref_group_builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
type Configger interface {
15-
Config(prefix string) (*git.Config, error)
15+
GetConfig(prefix string) (*git.Config, error)
1616
}
1717

1818
// RefGroupBuilder handles reference-related options and puts together
@@ -114,7 +114,7 @@ func (rgb *RefGroupBuilder) readRefgroupsFromGitconfig(configger Configger) erro
114114
return nil
115115
}
116116

117-
config, err := configger.Config("refgroup")
117+
config, err := configger.GetConfig("refgroup")
118118
if err != nil {
119119
return err
120120
}

0 commit comments

Comments
 (0)