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

cosmicexplorer
Copy link
Contributor

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.

@@ -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!!!
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cosmicexplorer cosmicexplorer merged commit e16bd1f into pantsbuild:master Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants