-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 logScanner fails to parse pointer file containing unicode chars #5655
Conversation
Git will quote paths using unicode characters in git log but the fileHeaderRegex does not account for optional quotes in the log. This change fixes the regex to account for quotes due to unicode characters and improves the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine, but don't we need to handle the octal escapes as well? The example in the PR message shows a couple of octal escapes that we'd probably want to handle in setFilename
.
They are already matched by the current regex, see |
Right, but |
Ah, good catch! |
Git will quote paths using Unicode characters in git log, but the fileHeaderRegex does not account for optional quotes in the log.
This change fixes the regex to account for quotes due to Unicode characters and improves the tests.
Due to this bug, git lfs prune might accidentally prune recent, unpushed, or stashed files that contain unicode character if there is more than one changed file in the commit.
One might see a git log looking like this, for example (note the quotation marks).
Note: This is rather critical because if the file "Source Assets/Audio/Alltagsger\303\244usche - Kamera - Blitzlicht.mp3" would be unpushed or stashed,
prune --force
would delete the file as well