Skip to content

GitFilesystemHook: handle apostrophe in filename #64

@Wenzel

Description

@Wenzel

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("\"")]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions