Skip to content

Incorrect behavior when a filename starts with dash #1072

Closed

Description

@sh2ka

When a filename starts with dash I get a error message:

git lfs clean <path>

Read the contents of a large file from standard input, and write a Git
LFS pointer file for that file to standard output.

Clean is typically run by Git's clean filter, configured by the repository's
Git attributes.

Error: unknown shorthand flag: 'T' in -Total_Eclipse_Of_The_Heart-84093257.mp3
error: cannot feed the input to external filter git-lfs clean %f
error: external filter git-lfs clean %f failed
fatal: -Total_Eclipse_Of_The_Heart-84093257.mp3: clean filter 'lfs' failed

Git itself doesn't fail if I disable lfs extension for repository. It seems that lfs calls utilities without -- argument that splits filenames section from the options section of the utility command line (for example, you can call them like this cat -- -file-starting-with-dash).

Activity

  1. technoweenie commented on Mar 14, 2016

    @technoweenie
    Contributor

    Interesting. Try this:

    $ git config filter.lfs.smudge "git-lfs smudge -- %f"
    $ git config filter.lfs.clean "git-lfs clean -- %f"

    We can get a permanent fix in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions