瀏覽代碼

capitalize env vars

Peter Rowlands 4 年之前
父節點
當前提交
09a53a7496
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 4 4
      dulwich/config.py
  2. 2 2
      dulwich/tests/test_config.py

+ 4 - 4
dulwich/config.py

@@ -535,13 +535,13 @@ def _find_git_in_win_reg():
 
 # There is no set standard for system config dirs on windows. We try the
 # following:
-#   - %ProgramData%/Git/config - (deprecated) Windows config dir per CGit docs
-#   - %ProgramFiles%/Git/etc/gitconfig - Git for Windows (msysgit) config dir
+#   - %PROGRAMDATA%/Git/config - (deprecated) Windows config dir per CGit docs
+#   - %PROGRAMFILES%/Git/etc/gitconfig - Git for Windows (msysgit) config dir
 #     Used if CGit installation (Git/bin/git.exe) is found in PATH in the
 #     system registry
 def get_win_system_paths():
-    if "ProgramData" in os.environ:
-        yield os.path.join(os.environ["ProgramData"], "Git", "config")
+    if "PROGRAMDATA" in os.environ:
+        yield os.path.join(os.environ["PROGRAMDATA"], "Git", "config")
 
     for git_dir in _find_git_in_win_path():
         yield os.path.join(git_dir, "etc", "gitconfig")

+ 2 - 2
dulwich/tests/test_config.py

@@ -294,7 +294,7 @@ class StackedConfigTests(TestCase):
             paths = set(get_win_system_paths())
         self.assertEqual(
             {
-                os.path.join(os.environ.get("ProgramData"), "Git", "config"),
+                os.path.join(os.environ.get("PROGRAMDATA"), "Git", "config"),
                 os.path.join(install_dir, "etc", "gitconfig"),
             },
             paths,
@@ -316,7 +316,7 @@ class StackedConfigTests(TestCase):
                 paths = set(get_win_system_paths())
         self.assertEqual(
             {
-                os.path.join(os.environ.get("ProgramData"), "Git", "config"),
+                os.path.join(os.environ.get("PROGRAMDATA"), "Git", "config"),
                 os.path.join(install_dir, "etc", "gitconfig"),
             },
             paths,