From e5c6fa237776870483cbe227d7f7ea943f35cb12 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Thu, 27 Jul 2017 17:17:34 +0200 Subject: 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. --- plumbing/format/config/fixtures_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plumbing/format/config/fixtures_test.go') 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"), + }, } -- cgit