commit 98ec1f70c34ae02be01eb1b7969d85d8cb57e937 from: Peter Rowlands date: Fri Jul 14 06:04:35 2023 UTC config: check both git/etc and git/mingw64/etc for system gitconfig on windows commit - b415021b0a3fb9b3ea738686aac6866dc0ce6c82 commit + 98ec1f70c34ae02be01eb1b7969d85d8cb57e937 blob - 511bc3ce273087fd5733e3ee3895bd3185bfb55e blob + 0d47e2b8bea1f490adb604be4f20c5a8eec0424e --- dulwich/config.py +++ dulwich/config.py @@ -620,9 +620,15 @@ def _find_git_in_win_path(): for exe in ("git.exe", "git.cmd"): for path in os.environ.get("PATH", "").split(";"): if os.path.exists(os.path.join(path, exe)): - # exe path is .../Git/bin/git.exe or .../Git/cmd/git.exe + # in windows native shells (powershell/cmd) exe path is + # .../Git/bin/git.exe or .../Git/cmd/git.exe + # + # in git-bash exe path is .../Git/mingw64/bin/git.exe git_dir, _bin_dir = os.path.split(path) yield git_dir + parent_dir, basename = os.path.split(git_dir) + if basename == "mingw32" or basename == "mingw64": + yield parent_dir break