Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests with non-ascii characters
  • Loading branch information
George-Ogden committed Dec 1, 2025
commit 171062655e24b6a6ca1a3beab3c7679278350ab5
7 changes: 7 additions & 0 deletions test/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ def test_clone_from_pathlike(self, rw_dir):
original_repo = Repo.init(osp.join(rw_dir, "repo"))
Repo.clone_from(PathLikeMock(original_repo.git_dir), PathLikeMock(os.path.join(rw_dir, "clone_pathlike")))

@with_rw_directory
def test_clone_from_pathlike_unicode_repr(self, rw_dir):
original_repo = Repo.init(osp.join(rw_dir, "repo-áēñöưḩ̣"))
Repo.clone_from(
PathLikeMock(original_repo.git_dir), PathLikeMock(os.path.join(rw_dir, "clone_pathlike-áēñöưḩ̣"))
)

@with_rw_directory
def test_clone_from_pathlib_withConfig(self, rw_dir):
original_repo = Repo.init(osp.join(rw_dir, "repo"))
Expand Down
9 changes: 9 additions & 0 deletions test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,15 @@ def test_index_add_pathlike(self, rw_repo):

rw_repo.index.add(PathLikeMock(str(file)))

@with_rw_repo("HEAD")
def test_index_add_pathlike_unicode(self, rw_repo):
git_dir = Path(rw_repo.git_dir)

file = git_dir / "file-áēñöưḩ̣.txt"
file.touch()

rw_repo.index.add(PathLikeMock(str(file)))

@with_rw_repo("HEAD")
def test_index_add_non_normalized_path(self, rw_repo):
git_dir = Path(rw_repo.git_dir)
Expand Down
Loading