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 ls-files matching regexp #3845

Merged
merged 1 commit into from Jul 27, 2020
Merged

Fix ls-files matching regexp #3845

merged 1 commit into from Jul 27, 2020

Conversation

nobu
Copy link
Contributor

@nobu nobu commented Jul 22, 2020

Description:

As splitting by NUL means to allow the file names to contain newlines, path names should match at beginning-of-string instead of beginning-of-line.

What was the end-user or developer problem that led to this PR?

Nothing.
Sane programmers never use newline in pathnames.

What is your fix for the problem, implemented in this PR?

Match by \A instead of ^.
Also made a regexp group uncaptured.


Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

As splitting by NUL means to allow the file names to contain
newlines, path names should match at beginning-of-string instead
of beginning-of-line.
Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Looks good! 💜

@hsbt hsbt added this to the 3.2.0 milestone Jul 27, 2020
@hsbt hsbt merged commit 97ebb3f into rubygems:master Jul 27, 2020
hsbt added a commit that referenced this pull request Sep 24, 2020
deivid-rodriguez pushed a commit that referenced this pull request Oct 5, 2020
Fix ls-files matching regexp

(cherry picked from commit 97ebb3f)
deivid-rodriguez pushed a commit that referenced this pull request Oct 5, 2020
Fix ls-files matching regexp

(cherry picked from commit 97ebb3f)
deivid-rodriguez pushed a commit that referenced this pull request Oct 5, 2020
Fix ls-files matching regexp

(cherry picked from commit 97ebb3f)
deivid-rodriguez pushed a commit that referenced this pull request Oct 6, 2020
Fix ls-files matching regexp

(cherry picked from commit 97ebb3f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants