瀏覽代碼

Use indentation in config file consistent with C Git.

Bug: https://bugs.launchpad.net/dulwich/+bug/1031356
Jelmer Vernooij 12 年之前
父節點
當前提交
60742876dd
共有 3 個文件被更改,包括 6 次插入3 次删除
  1. 3 0
      NEWS
  2. 1 1
      dulwich/config.py
  3. 2 2
      dulwich/tests/test_config.py

+ 3 - 0
NEWS

@@ -4,6 +4,9 @@
 
   * 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
 
  BUG FIXES

+ 1 - 1
dulwich/config.py

@@ -304,7 +304,7 @@ class ConfigFile(ConfigDict):
             else:
                 f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
             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):

+ 2 - 2
dulwich/tests/test_config.py

@@ -137,14 +137,14 @@ class ConfigFileTests(TestCase):
         c.set(("core", ), "foo", "bar")
         f = StringIO()
         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):
         c = ConfigFile()
         c.set(("branch", "blie"), "foo", "bar")
         f = StringIO()
         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):
         cf = self.from_file("[branch.foo] foo = bar\n")