Browse Source

tests: disable system-wide config with GIT_CONFIG_NOSYSTEM

Peter Rowlands 3 years ago
parent
commit
819c632ae3
2 changed files with 1 additions and 9 deletions
  1. 1 0
      dulwich/tests/__init__.py
  2. 0 9
      dulwich/tests/test_porcelain.py

+ 1 - 0
dulwich/tests/__init__.py

@@ -43,6 +43,7 @@ class TestCase(_TestCase):
         super(TestCase, self).setUp()
         self._old_home = os.environ.get("HOME")
         os.environ["HOME"] = "/nonexistant"
+        os.environ["GIT_CONFIG_NOSYSTEM"] = "1"
 
     def tearDown(self):
         super(TestCase, self).tearDown()

+ 0 - 9
dulwich/tests/test_porcelain.py

@@ -1820,11 +1820,6 @@ class StatusTests(PorcelainTestCase):
         with open(file_path, "wb") as f:
             f.write(b"line1\r\nline2")
 
-        if sys.platform == "win32":
-            c = self.repo.get_config()
-            c.set("core", "autocrlf", "false")
-            c.write_to_path()
-
         results = porcelain.status(self.repo)
         self.assertDictEqual({"add": [], "delete": [], "modify": []}, results.staged)
         self.assertListEqual(results.unstaged, [b"crlf"])
@@ -1861,10 +1856,6 @@ class StatusTests(PorcelainTestCase):
 
     def test_status_autocrlf_input(self):
         # Commit existing file with CRLF
-        c = self.repo.get_config()
-        c.set("core", "autocrlf", "false")
-        c.write_to_path()
-
         file_path = os.path.join(self.repo.path, "crlf-exists")
         with open(file_path, "wb") as f:
             f.write(b"line1\r\nline2")