diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-06-21 11:45:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 11:45:00 +0800 |
commit | f0c6e1164f390081a27de952552aa83d34035f2a (patch) | |
tree | fcd116711c75c126c2fd083bb6a8c78ced5870ef /git/repo | |
parent | 6660b8463b86ea92ff56baebfcebc7c8a6e933fa (diff) | |
parent | 2996f402f11565c3ad93aedfe070f4f5f571e72e (diff) | |
download | gitpython-f0c6e1164f390081a27de952552aa83d34035f2a.tar.gz |
Merge pull request #1455 from DWesl/patch-1
Re-enable Cygwin CI and get most tests passing
Diffstat (limited to 'git/repo')
-rw-r--r-- | git/repo/base.py | 7 | ||||
-rw-r--r-- | git/repo/fun.py | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index 111a350e..5a85cc4e 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -29,7 +29,7 @@ from git.remote import Remote, add_progress, to_progress_instance from git.util import ( Actor, finalize_process, - decygpath, + cygpath, hex_to_bin, expand_path, remove_password_if_present, @@ -175,7 +175,10 @@ class Repo(object): if not epath: epath = os.getcwd() if Git.is_cygwin(): - epath = decygpath(epath) + # Given how the tests are written, this seems more likely to catch + # Cygwin git used from Windows than Windows git used from Cygwin. + # Therefore changing to Cygwin-style paths is the relevant operation. + epath = cygpath(epath) epath = epath or path or os.getcwd() if not isinstance(epath, str): diff --git a/git/repo/fun.py b/git/repo/fun.py index 8a07c2ab..2ca2e3d6 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -7,7 +7,7 @@ from string import digits from git.exc import WorkTreeRepositoryUnsupported from git.objects import Object from git.refs import SymbolicReference -from git.util import hex_to_bin, bin_to_hex, decygpath +from git.util import hex_to_bin, bin_to_hex, cygpath from gitdb.exc import ( BadObject, BadName, @@ -109,7 +109,9 @@ def find_submodule_git_dir(d: "PathLike") -> Optional["PathLike"]: if Git.is_cygwin(): ## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes. - path = decygpath(path) + # Cygwin git understands Cygwin paths much better than Windows ones + # Also the Cygwin tests are assuming Cygwin paths. + path = cygpath(path) if not osp.isabs(path): path = osp.normpath(osp.join(osp.dirname(d), path)) return find_submodule_git_dir(path) |