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 --owner-of path matching to remove repeated directory separators #7588

Merged

Conversation

Projects
None yet
2 participants
@cosmicexplorer
Copy link
Contributor

commented Apr 18, 2019

Problem

@wisechengyi brought this up in another chat, where repeated forward slashes would cause silent errors in target detection for --owner-of, returning only the first owning target in cases where multiple targets owned the same file (see test_owner_list_repeated_directory_separator() in the diff for an example).

Solution

  • Remove repeated / in all file_option, dir_option, and target_option options.

Result

Paths to files for --owner-of detection can contain multiple forward slashes in a row, and that potentially makes them easier to generate by script.

cosmicexplorer added some commits Apr 18, 2019

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:fix-file-path-repeated-slash branch from 6a06a5c to b5b1384 Apr 18, 2019

cosmicexplorer added some commits Apr 18, 2019

@@ -592,12 +593,14 @@ def check(val):
merged_rank = ranked_vals[-1].rank
merged_val = ListValueComponent.merge(
[rv.value for rv in ranked_vals if rv.value is not None]).val
# TODO: run `check()` for all elements of a list option too!!!

This comment has been minimized.

Copy link
@stuhood

stuhood Apr 19, 2019

Member

Or merge check with _convert_member_type? But yea, in a followup.

@cosmicexplorer cosmicexplorer merged commit e16bd1f into pantsbuild:master Apr 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.