aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/config')
-rw-r--r--plumbing/format/config/encoder.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/plumbing/format/config/encoder.go b/plumbing/format/config/encoder.go
index 6d17a5a..4eac896 100644
--- a/plumbing/format/config/encoder.go
+++ b/plumbing/format/config/encoder.go
@@ -53,17 +53,13 @@ func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error {
return err
}
- if err := e.encodeOptions(s.Options); err != nil {
- return err
- }
-
- return nil
+ return e.encodeOptions(s.Options)
}
func (e *Encoder) encodeOptions(opts Options) error {
for _, o := range opts {
pattern := "\t%s = %s\n"
- if strings.Index(o.Value, "\\") != -1 {
+ if strings.Contains(o.Value, "\\") {
pattern = "\t%s = %q\n"
}