Skip to content

Error if the file name includes a single quote #85

@Leandros

Description

@Leandros

The arguments to git are quoted in single quotes to allow file names with spaces, but this proves a problem, since files with ' in their names are now producing an error (for the imaginary file This doesn't work.txt):

Error: Could not run 'git --git-dir='/Users/redacted/workspace/redacted/.git' --work-tree='/Users/redacted/workspace/redacted' show master:'redacted/redacted/redacted/This doesn't work.txt' | LC_ALL=C file --mime-type -' => sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git --git-dir='/Users/redacted/workspace/redacted/.git' --work-tree='/Users/redacted/workspace/redacted' show master:'redacted/redacted/redacted/This doesn't work.txt' | LC_ALL=C file --mime-type -'.
Try --help for help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions