git clone android source code抛出error: invalid path 'luni/src/test/resources/org/apache/harmony/t

Posted 雪舞

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git clone android source code抛出error: invalid path 'luni/src/test/resources/org/apache/harmony/t相关的知识,希望对你有一定的参考价值。

今天更新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 :/

以上是关于git clone android source code抛出error: invalid path 'luni/src/test/resources/org/apache/harmony/t的主要内容,如果未能解决你的问题,请参考以下文章

为啥 `git svn clone` 不能转换所有的 SVN 分支?

解决Android源码下载“fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle”

git clone 指定分支的内容

Android : 下载内核源码 and 编译打包

Git学习Git如何Clone带有Submodule的仓库?

Git学习Git如何Clone带有Submodule的仓库?