aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/fixtures_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-27 17:17:34 +0200
committerSantiago M. Mola <santi@mola.io>2017-08-01 13:01:59 +0200
commite5c6fa237776870483cbe227d7f7ea943f35cb12 (patch)
treed8708626c6e4bdacdf3d3b796a17025908b6606b /plumbing/format/config/fixtures_test.go
parent1e70916ca7e4d5c0ad00edbfd1877e06d7587fc6 (diff)
downloadgo-git-e5c6fa237776870483cbe227d7f7ea943f35cb12.tar.gz
config: preserve option order on config marshalling
Do not change order of options (e.g. in RemoteConfig) when serializing for any option whose value has not changed.
Diffstat (limited to 'plumbing/format/config/fixtures_test.go')
-rw-r--r--plumbing/format/config/fixtures_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/plumbing/format/config/fixtures_test.go b/plumbing/format/config/fixtures_test.go
index 12ff288..f3533df 100644
--- a/plumbing/format/config/fixtures_test.go
+++ b/plumbing/format/config/fixtures_test.go
@@ -87,4 +87,18 @@ var fixtures = []*Fixture{
AddOption("sect1", "subsect1", "opt2", "value2b").
AddOption("sect1", "subsect2", "opt2", "value2"),
},
+ {
+ Raw: `
+ [sect1]
+ opt1 = value1
+ opt1 = value2
+ `,
+ Text: `[sect1]
+ opt1 = value1
+ opt1 = value2
+`,
+ Config: New().
+ AddOption("sect1", "", "opt1", "value1").
+ AddOption("sect1", "", "opt1", "value2"),
+ },
}