8000 config: allow SetOption to take multiple values · go-git/go-git@22cf415 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22cf415

Browse files
committed
config: allow SetOption to take multiple values
This behaviour is supported by Git CLI and also by the underlying Options struct and was already exposed on the Subsection.SetOption(..) method. This commit updates the Section.SetOptions(..) signature to match and allow easier setting of multiple values from the Section level. Relates to: GH #395
1 parent 1ffe657 commit 22cf415

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plumbing/format/config/section.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ func (s *Section) AddOption(key string, value string) *Section {
128128

129129
// SetOption adds a new Option to the Section. If the option already exists, is replaced.
130130
// The updated Section is returned.
131-
func (s *Section) SetOption(key string, value string) *Section {
132-
s.Options = s.Options.withSettedOption(key, value)
131+
func (s *Section) SetOption(key string, value ...string) *Section {
132+
s.Options = s.Options.withSettedOption(key, value...)
133133
return s
134134
}
135135

0 commit comments

Comments
 (0)
0