File tree 1 file changed +9
-3
lines changed
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):
908
908
assert h == original_hash
909
909
910
910
# 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 ))
912
915
assert h == original_hash
913
916
914
917
# Test missing path
@@ -944,8 +947,11 @@ def test_repository_hashfile_filter(testrepo):
944
947
h = testrepo .hashfile ('hellocrlf.txt' )
945
948
assert h == original_hash
946
949
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 ))
949
955
assert h == original_hash
950
956
951
957
# Bypass filters
You can’t perform that action at this time.
0 commit comments