diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-07-19 01:08:41 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-07-19 01:08:41 +0200 |
commit | acb1a5f7a47e4759bbe1592a0a58571bda6289e7 (patch) | |
tree | 20342aa8aa67aefe00000f1e3770638675905634 /plumbing/format/config | |
parent | 330a45a58eef95095d9fb7343f8daeb8c408e4f5 (diff) | |
download | go-git-acb1a5f7a47e4759bbe1592a0a58571bda6289e7.tar.gz |
plumbing: format config, escape back slash
Diffstat (limited to 'plumbing/format/config')
-rw-r--r-- | plumbing/format/config/decoder.go | 4 | ||||
-rw-r--r-- | plumbing/format/config/encoder.go | 2 |
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" } |