gpt4 book ai didi

git - 使用 JGit 更新子模块时出现 MissingObjectException

转载 作者:太空狗 更新时间:2023-10-29 13:40:00 24 4
gpt4 key购买 nike

我正在尝试更新子模块:

git.submoduleUpdate().call()

但我得到:

org.eclipse.jgit.api.errors.JGitInternalException: Missing unknown e88da827bdc5c5a4b0d87b8be79b81567759411b
at org.eclipse.jgit.api.SubmoduleUpdateCommand.call(SubmoduleUpdateCommand.java:211)
at kontinuum.WorkPackageProcessorKt.processWorkPackages(WorkPackageProcessor.kt:43)
at kontinuum.MainKt.main(Main.kt:30)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown e88da827bdc5c5a4b0d87b8be79b81567759411b
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:145)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:226)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
at org.eclipse.jgit.api.SubmoduleUpdateCommand.call(SubmoduleUpdateCommand.java:175)
... 2 more

有趣的是它在控制台上运行:

kontinuum@ligi-tp ~/k/w/l/SurvivalManual> git submodule update
remote: Counting objects: 27, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 27 (delta 17), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (27/27), done.
From https://github.com/ligi/SurvivalManual.wiki
b72e23e..e88da82 master -> origin/master
Submodule path 'android/src/main/assets/md': checked out 'e88da827bdc5c5a4b0d87b8be79b81567759411b'

最佳答案

正如@max630 所指出的,这是一个 jgit 错误:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=470318

这是我目前的解决方法:

val walk = SubmoduleWalk.forIndex(git.repository)
while (walk.next()) {
val submodule = walk.repository
Git.wrap(submodule).fetch().call()
submodule.close()
}

关于git - 使用 JGit 更新子模块时出现 MissingObjectException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43214160/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com