oswatcher
oswatcher copied to clipboard
GitFilesystemHook: handle apostrophe in filename
When commiting a file with an apostrophe ’ as part of the filename, git ls-files will return it as an escaped character:

This breaks our GitFilesystemHook when a guest filepath already exists on the git, and should be removed from the self.to_remove_tree dict:
https://github.com/Wenzel/oswatcher/blob/de3d47380f927ded4ccfed3625aec750321a7986/hooks/filesystem.py#L372
For the moment we simply ignore these files, by detecting when a filepath returns by git ls-files startswith an apostrophe:
https://github.com/Wenzel/oswatcher/blob/de3d47380f927ded4ccfed3625aec750321a7986/hooks/filesystem.py#L329