File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -908,7 +908,10 @@ def test_repository_hashfile(testrepo):
908908 assert h == original_hash
909909
910910 # Test absolute path
911- h = testrepo .hashfile (str (Path (testrepo .workdir , 'hello.txt' )))
911+ # For best results on Windows, pass a pure POSIX path. (See https://github.com/libgit2/libgit2/issues/6825)
912+ absolute_path = Path (testrepo .workdir , 'hello.txt' )
913+ absolute_path = absolute_path .as_posix () # Windows compatibility
914+ h = testrepo .hashfile (str (absolute_path ))
912915 assert h == original_hash
913916
914917 # Test missing path
@@ -944,8 +947,11 @@ def test_repository_hashfile_filter(testrepo):
944947 h = testrepo .hashfile ('hellocrlf.txt' )
945948 assert h == original_hash
946949
947- # Treat absolute path with filters
948- h = testrepo .hashfile (str (Path (testrepo .workdir , 'hellocrlf.txt' )))
950+ # Treat absolute path with filters.
951+ # For best results on Windows, pass a pure POSIX path. (See https://github.com/libgit2/libgit2/issues/6825)
952+ absolute_path = Path (testrepo .workdir , 'hellocrlf.txt' )
953+ absolute_path = absolute_path .as_posix () # Windows compatibility
954+ h = testrepo .hashfile (str (absolute_path ))
949955 assert h == original_hash
950956
951957 # Bypass filters
You can’t perform that action at this time.
0 commit comments