Commit 4e4a2b86 authored by Garrett Beaty's avatar Garrett Beaty Committed by LUCI CQ

Fix get_files_affected_by_patch to work with spaces in file names.

Bug: 1288604
Change-Id: Ie116316062e50138668299538a5e0759a1dd3fa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3459466
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 9ae2169b
......@@ -253,7 +253,7 @@ class TryserverApi(recipe_api.RecipeApi):
self.m.raw_io.test_api.stream_output('foo.cc'),
**kwargs)
paths = [self.m.path.join(patch_root, p.decode('utf-8')) for p in
step_result.stdout.split()]
step_result.stdout.splitlines()]
paths.sort()
if self.m.platform.is_win:
# Looks like "analyze" wants POSIX slashes even on Windows (since git
......
......@@ -90,3 +90,14 @@ def GenTests(api):
api.post_check(post_process.StatusSuccess),
api.post_process(post_process.DropExpectation),
)
yield api.test(
'file-with-spaces',
api.tryserver.get_files_affected_by_patch(['file with spaces.txt']),
api.properties(
patch_root='',
expected_files=['file with spaces.txt'],
),
api.post_check(post_process.StatusSuccess),
api.post_process(post_process.DropExpectation),
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment