Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for filenames which are quoted (usually containing inte…
…rnational/unicode characters).
- Loading branch information
Showing
2 changed files
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ee90922
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.
eval is evil. This is the wrong way to do this
ee90922
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.
eval is the wrong way to do this. That introduces security problems. Why not simply remove the first and last character?
ee90922
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.
Hey, the reason I added the eval is because git returns a slash encoded string whereas Dir.glob, it appears, deals directly with the international characters, and that will fail during the comparison for finding untracked files. E.g.
<pre>
> > “Euge\314\201nie Eckler.jpg” == “Eugénie Eckler.jpg”
> > => false
> >
ee90922
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.
hmm ok. I just tested it, eval seems to be no problem because git properly escapes quotes etc. But using eval to remove escape sequences just does not feel right. Maybe there’s a better way to do it.
ee90922
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.
I agree, it isn’t ideal. Perhaps we could escape the filenames that Dir.glob returns?