|
7 | 7 | import io |
8 | 8 | import os |
9 | 9 | import os.path as osp |
10 | | -import sys |
11 | 10 | from unittest import mock |
12 | 11 |
|
13 | 12 | import pytest |
@@ -411,11 +410,6 @@ def test_multiple_include_paths_with_same_key(self, rw_dir): |
411 | 410 | assert cr.get_value("user", "name") == "from-inc1" |
412 | 411 | assert cr.get_value("core", "bar") == "from-inc2" |
413 | 412 |
|
414 | | - @pytest.mark.xfail( |
415 | | - sys.platform == "win32", |
416 | | - reason='Second config._has_includes() assertion fails (for "config is included if path is matching git_dir")', |
417 | | - raises=AssertionError, |
418 | | - ) |
419 | 413 | @with_rw_directory |
420 | 414 | def test_conditional_includes_from_git_dir(self, rw_dir): |
421 | 415 | # Initiate repository path. |
@@ -443,6 +437,14 @@ def test_conditional_includes_from_git_dir(self, rw_dir): |
443 | 437 | assert config._has_includes() |
444 | 438 | assert config._included_paths() == [("path", path2)] |
445 | 439 |
|
| 440 | + # Ensure that Git's forward-slash syntax matches native Windows paths. |
| 441 | + with open(path1, "w") as stream: |
| 442 | + stream.write(template.format("gitdir", git_dir.replace("\\", "/"), path2)) |
| 443 | + |
| 444 | + with GitConfigParser(path1, repo=repo) as config: |
| 445 | + assert config._has_includes() |
| 446 | + assert config._included_paths() == [("path", path2)] |
| 447 | + |
446 | 448 | # Ensure that config is ignored if case is incorrect. |
447 | 449 | with open(path1, "w") as stream: |
448 | 450 | stream.write(template.format("gitdir", git_dir.upper(), path2)) |
|
0 commit comments