-I
即使过滤器以八进制编码传递,git lfs ls-files过滤器似乎也不适用于非 ASCII 文件夹名称,这可以通过下面的 bash 脚本确认:
mkdir LfsTestRepo
cd LfsTestRepo
git init
git lfs -v # git-lfs/2.7.2 (GitHub; windows amd64; go 1.12.2; git 08a08ae0)
git lfs install
echo "*.dll filter=lfs diff=lfs merge=lfs -text" > .gitattributes
# ASCII
mkdir "A B"
echo "some binary data" > "A B/C.dll"
# Non-ASCII
mkdir "А Б"
echo "some binary data" > "А Б/В.dll"
git add --all
git commit -m "DLLs added"
git lfs ls-files # Shows both files
git lfs ls-files -I "/A B/*" # ASCII - shows the file with folder filter
git lfs ls-files -I "/А Б/*" # Non-ASCII - doesn't show the file with folder filter
git ls-files -s ":(attr:filter=lfs)А Б" # Non-ASCII native ls-files shows the file (octal encoding)
git lfs ls-files -I "/\320\220 \320\221/*" # Non-ASCII - doesn't show the file even with octal encoding
虽然在我们的特殊情况下可能不会遇到具有非 ASCII 字符的文件夹,但它仍然是一个小麻烦,并且可能是一个有效的用例。
那么,我做错了什么,还是只是git lfs ls-files -I
不支持带有非 ASCII 字符的过滤器?