今天更新libcore源碼時,遇到error: invalid path 'luni/src/test/resources/org/apache/harmony/tests/java/lang/test?.properties',原因是android源碼中文件的命名不符合windows系統的規范。
$ git clone https://android.googlesource.com/platform/libcore
Cloning into 'libcore'...
remote: Sending approximately 113.05 MiB ...
remote: Counting objects: 879, done
remote: Total 278583 (delta 166925), reused 278583 (delta 166925)
Receiving objects: 100% (278583/278583), 113.05 MiB | 23.11 MiB/s, done.
Resolving deltas: 100% (166925/166925), done.
error: invalid path 'luni/src/test/resources/org/apache/harmony/tests/java/lang/test?.properties'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
解決方案:
到已下載的libcore目錄下,執行提示的語句:
git restore --source=HEAD :/