Skip to content

git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa" fail to execute in win 10 #5409

@zhoushaokun

Description

@zhoushaokun

Describe the bug

As git lfs track doc said,we can use --filename to set path with special character such as [ ] * ?. But when I do this in my win 10 computer, it went wrong.

To Reproduce
Steps to reproduce the behavior:

  1. In win 10, New two files named: "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa" in dir [2023-06-23] in any installed git lfs repo's root folder.
  2. Open git bash command execute git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa"
  3. See error
    image

And the .gitattributes file will add one line config which is wired, because it has already ended with error. Why should have some effect on really disk file?

Expected behavior

using --filename for paths with special character and worked as doc said

System environment

git-lfs/3.3.0 (GitHub; windows amd64; go 1.19; git e815aff5)
git version 2.36.1.windows.1

image

Additional context

Alse, I tried execute GIT_TRACE=1 git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa", the execution details follwoing:

image

From the details, I guess it may related to the git 'ls-files' '--cached' '--' '\[2023-06-23\]/1.tset',because when i execute the comand longly in my git bash it show that:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions