2
0
Эх сурвалжийг харах

Use indentation in config file consistent with C Git.

Bug: https://bugs.launchpad.net/dulwich/+bug/1031356
Jelmer Vernooij 12 жил өмнө
parent
commit
60742876dd

+ 3 - 0
NEWS

@@ -4,6 +4,9 @@
 
 
   * Push efficiency - report missing objects only. (#562676, Artem Tikhomirov)
   * Push efficiency - report missing objects only. (#562676, Artem Tikhomirov)
 
 
+  * Use indentation consistent with C Git in config files.
+    (#1031356, Curt Moore, Jelmer Vernooij)
+
 0.8.7	2012-11-27
 0.8.7	2012-11-27
 
 
  BUG FIXES
  BUG FIXES

+ 1 - 1
dulwich/config.py

@@ -304,7 +304,7 @@ class ConfigFile(ConfigDict):
             else:
             else:
                 f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
                 f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
             for key, value in values.iteritems():
             for key, value in values.iteritems():
-                f.write("%s = %s\n" % (key, _escape_value(value)))
+                f.write("\t%s = %s\n" % (key, _escape_value(value)))
 
 
 
 
 class StackedConfig(Config):
 class StackedConfig(Config):

+ 2 - 2
dulwich/tests/test_config.py

@@ -137,14 +137,14 @@ class ConfigFileTests(TestCase):
         c.set(("core", ), "foo", "bar")
         c.set(("core", ), "foo", "bar")
         f = StringIO()
         f = StringIO()
         c.write_to_file(f)
         c.write_to_file(f)
-        self.assertEqual("[core]\nfoo = bar\n", f.getvalue())
+        self.assertEqual("[core]\n\tfoo = bar\n", f.getvalue())
 
 
     def test_write_to_file_subsection(self):
     def test_write_to_file_subsection(self):
         c = ConfigFile()
         c = ConfigFile()
         c.set(("branch", "blie"), "foo", "bar")
         c.set(("branch", "blie"), "foo", "bar")
         f = StringIO()
         f = StringIO()
         c.write_to_file(f)
         c.write_to_file(f)
-        self.assertEqual("[branch \"blie\"]\nfoo = bar\n", f.getvalue())
+        self.assertEqual("[branch \"blie\"]\n\tfoo = bar\n", f.getvalue())
 
 
     def test_same_line(self):
     def test_same_line(self):
         cf = self.from_file("[branch.foo] foo = bar\n")
         cf = self.from_file("[branch.foo] foo = bar\n")