aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-19 01:08:41 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-07-19 01:08:41 +0200
commitacb1a5f7a47e4759bbe1592a0a58571bda6289e7 (patch)
tree20342aa8aa67aefe00000f1e3770638675905634 /plumbing/format
parent330a45a58eef95095d9fb7343f8daeb8c408e4f5 (diff)
downloadgo-git-acb1a5f7a47e4759bbe1592a0a58571bda6289e7.tar.gz
plumbing: format config, escape back slash
Diffstat (limited to 'plumbing/format')
-rw-r--r--plumbing/format/config/decoder.go4
-rw-r--r--plumbing/format/config/encoder.go2
2 files changed, 2 insertions, 4 deletions
diff --git a/plumbing/format/config/decoder.go b/plumbing/format/config/decoder.go
index c6ad3d8..0f02ce1 100644
--- a/plumbing/format/config/decoder.go
+++ b/plumbing/format/config/decoder.go
@@ -2,7 +2,6 @@ package config
import (
"io"
- "os"
"github.com/src-d/gcfg"
)
@@ -34,6 +33,5 @@ func (d *Decoder) Decode(config *Config) error {
config.AddOption(s, ss, k, v)
return nil
}
-
- return gcfg.ReadWithCallback(io.TeeReader(d, os.Stdout), cb)
+ return gcfg.ReadWithCallback(d, cb)
}
diff --git a/plumbing/format/config/encoder.go b/plumbing/format/config/encoder.go
index 76d73fd..6d17a5a 100644
--- a/plumbing/format/config/encoder.go
+++ b/plumbing/format/config/encoder.go
@@ -63,7 +63,7 @@ func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error {
func (e *Encoder) encodeOptions(opts Options) error {
for _, o := range opts {
pattern := "\t%s = %s\n"
- if strings.Index(o.Value, "\\") == -1 {
+ if strings.Index(o.Value, "\\") != -1 {
pattern = "\t%s = %q\n"
}