Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly generate network if path has spaces #357

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion codecov_cli/helpers/versioning_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def list_relevant_files(
filename[1:-1]
if filename.startswith('"') and filename.endswith('"')
else filename
for filename in res.stdout.decode("unicode_escape").strip().split()
for filename in res.stdout.decode("unicode_escape").strip().split("\n")
]


Expand Down
2 changes: 2 additions & 0 deletions tests/helpers/test_folder_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_search_files_with_folder_exclusion(tmp_path):
"another/some/banana.py",
"from/some/banana.py",
"to/some/banana.py",
"path/folder with space/banana.py",
"apple.py",
"banana.py",
]
Expand All @@ -56,6 +57,7 @@ def test_search_files_with_folder_exclusion(tmp_path):
tmp_path / "banana.py",
tmp_path / "from/some/banana.py",
tmp_path / "another/some/banana.py",
tmp_path / "path/folder with space/banana.py",
]
)
assert expected_results == sorted(
Expand Down
5 changes: 4 additions & 1 deletion tests/helpers/test_versioning_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_list_relevant_files_returns_correct_network_files(self, mocker, tmp_pat
return_value=mocked_subprocess,
)
# git ls-files diplays a single \n as \\\\n
mocked_subprocess.stdout = b'a.txt\nb.txt\n"a\\\\nb.txt"\nc.txt\nd.txt'
mocked_subprocess.stdout = b'a.txt\nb.txt\n"a\\\\nb.txt"\nc.txt\nd.txt\n.circleci/config.yml\nLICENSE\napp/advanced calculations/advanced_calculator.js\n'

vs = GitVersioningSystem()

Expand All @@ -105,6 +105,9 @@ def test_list_relevant_files_returns_correct_network_files(self, mocker, tmp_pat
"a\\nb.txt",
"c.txt",
"d.txt",
".circleci/config.yml",
"LICENSE",
"app/advanced calculations/advanced_calculator.js",
]

def test_list_relevant_files_fails_if_no_root_is_found(self, mocker):
Expand Down
Loading