commit 879fe6a17b694df8d6f4f91cdbf808a59d6a105d from: Jelmer Vernooij via: GitHub date: Fri Jul 14 09:33:18 2023 UTC Merge pull request #1194 from pmrowla/win-git-bash config: check both `git/etc` and `git/mingw64/etc` on windows commit - 75b0369cca6cf10dc7a8738e76057525dadddd10 commit + 879fe6a17b694df8d6f4f91cdbf808a59d6a105d blob - 8cb1849b6d8f8f57673fe936389714a148360095 blob + 1a32cba7c1d31c5b72e5a441694d35fe8dd8739d --- dulwich/config.py +++ dulwich/config.py @@ -633,9 +633,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