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

GitFilesystemHook: handle apostrophe in filename #64

Open
Wenzel opened this issue Feb 5, 2020 · 0 comments
Open

GitFilesystemHook: handle apostrophe in filename #64

Wenzel opened this issue Feb 5, 2020 · 0 comments
Labels

Comments

@Wenzel
Copy link
Owner

Wenzel commented Feb 5, 2020

When commiting a file with an apostrophe as part of the filename, git ls-files will return it as an escaped character:

Capture d’écran de 2020-02-06 00-19-58

This breaks our GitFilesystemHook when a guest filepath already exists on the git, and should be removed from the self.to_remove_tree dict:

self.logger.warning("Couldn't remove %s from old filesystem removal tree", relpath)

For the moment we simply ignore these files, by detecting when a filepath returns by git ls-files startswith an apostrophe:

for p in [Path(p) for p in self.repo.git.ls_files().split('\n') if not p.startswith("\"")]:

@Wenzel Wenzel added the bug label Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant