Eclipse 中的 Egit 缺失树 [英] Egit in eclipse missing tree

查看:32
本文介绍了Eclipse 中的 Egit 缺失树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来我有一个缺失的树错误.公平地说,我完全把我在 git 上的本地文件弄乱了,厌倦了,在我的 repo 上做了一个完整的硬盘删除,然后从远程 master 重新克隆.现在我收到以下错误.我做的第一件事就是为我的工作创建一个本地分支.

Looks like I have a missing tree error. Just to be fair, I did totally just mess up my local files on git and got fed up and did a complete hard disk delete on my repo and recloned from remote master. Now I'm getting the following error. One of the first things I did was create a local branch for my work.

如果我不删除所有内容,我可能已经恢复了很多工作,但是嘿,通过时态 - 对吧?(这可能显示了我现在对 git 和我的项目的心态......)

Chances are I could've recovered a lot of my work if I didn't delete everything but hey, pass tense - right? (This may show my state of my mind right now with git and my project too...)

如果有什么不同,我正在制作一个 android 项目.

If it makes any difference I am making an android project.

我正在阅读这篇帖子,它似乎很有帮助,但我不知道如何找到我的a30df1173f14dea24df661f1eef749fed2f4e1ed"sha1 哈希.

I'm reading this post and it seems helpful but I have no idea how to find my "a30df1173f14dea24df661f1eef749fed2f4e1ed" sha1 hash.

在做

git ls-tree a30df1173f14dea24df661f1eef749fed2f4e1ed

git ls-tree a30df1173f14dea24df661f1eef749fed2f4e1ed

给我以下内容

100755 blob 2851ba4fdf2a134f8fc97fd60b3045b73cd6039b    .DS_Store
100755 blob 3f9691c5dda29b09cb96060fd6ec7017f6c671d2    .classpath
100755 blob c50d3b4fe2f6221db617840561dc94d7690bb883    .gitignore
100755 blob 6b58f1723a252cfd314d108fadac4b71a4209c1c    .project
100755 blob 39f00018845d776de324707090d26c5153720e22    AndroidManifest.xml
100755 blob 94a9ed024d3859793618152ea559a168bbcbb5e2    COPYING
100755 blob c1853e4c312a938d5890f5f4e0844782429ba11e    default.properties
040000 tree 423accda532f8788f916b26b863ddf32e2896aa6    docs
160000 commit 0000000000000000000000000000000000000000  eagle vision
100755 blob 424f2604203eabd2310165b143b430326aa87ee7    ic_launcher-web.png
040000 tree 2b83cd828cd11a11e84a2d8f646dfa40de109827    libs
100644 blob 8a7b1fac8f8c12e925e56776f225730c4712f92a    lint.xml
040000 tree c0182f719fccf5fc8b0d7658c3d15fe4deac0d9e    plugins
100755 blob f2fe1559a217865a5454add526dcc446f892385b    proguard-project.txt
100755 blob 9ae01de96458dbded45d2a442c09c0f4d33e473a    project.properties
040000 tree 3c9446b3bb23eebe80942992ee03e01a7390ba80    res
040000 tree 895e957ccc4ee642127c25a3481d784302e44a70    src

在所有这些 0 中,鹰的视觉似乎很奇怪:

Out of all of them the eagle vision seems weird with all those 0's:

160000 次提交 0000000000000000000000000000000000000000 鹰眼

160000 commit 0000000000000000000000000000000000000000 eagle vision

虽然我不太确定我要去哪里.尝试通过 git faq 并没有走多远.

Not really sure where I'm going with this though. Trying to go through the git faq doesn't go very far.

这是整个错误:

eclipse.buildId=v22.0.0-675183
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product com.android.ide.eclipse.adt.package.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product com.android.ide.eclipse.adt.package.product

Error
Sun Oct 13 21:11:59 CDT 2013
Missing tree 2ec4e5b3e0e3d9ccc766fd1ed0dccaedcef3e53a

org.eclipse.jgit.errors.MissingObjectException: Missing tree 2ec4e5b3e0e3d9ccc766fd1ed0dccaedcef3e53a
    at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:127)
    at org.eclipse.jgit.treewalk.CanonicalTreeParser.reset(CanonicalTreeParser.java:201)
    at org.eclipse.jgit.treewalk.TreeWalk.parserFor(TreeWalk.java:984)
    at org.eclipse.jgit.treewalk.TreeWalk.addTree(TreeWalk.java:468)
    at org.eclipse.egit.core.synchronize.GitSyncCache.loadDataFromGit(GitSyncCache.java:130)
    at org.eclipse.egit.core.synchronize.GitSyncCache.getAllData(GitSyncCache.java:85)
    at org.eclipse.egit.core.synchronize.GitSyncCache.getAllData(GitSyncCache.java:63)
    at org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber.refresh(GitResourceVariantTreeSubscriber.java:180)
    at org.eclipse.team.core.subscribers.Subscriber.refresh(Subscriber.java:466)
    at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.handleRepositoryChange(GitSubscriberMergeContext.java:142)
    at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.access$0(GitSubscriberMergeContext.java:133)
    at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext$1.indexDiffChanged(GitSubscriberMergeContext.java:68)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache.notifyListeners(IndexDiffCache.java:98)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache.access$0(IndexDiffCache.java:89)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache$1.indexDiffChanged(IndexDiffCache.java:84)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.notifyListeners(IndexDiffCacheEntry.java:425)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$8(IndexDiffCacheEntry.java:417)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$5.run(IndexDiffCacheEntry.java:358)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

推荐答案

160000 是一个特殊条目 用于录制子模块.
SHA1 等于 40 个零表示子模块已被删除(参见 git-submodule.sh) 或在 未知状态:

160000 is a special entry for recording a submodule.
A SHA1 equals to 40 zeros means the submodule has been deleted (see git-submodule.sh) or in an unknown state:

当您将某物与工作树状态进行比较时,并且当工作树状态是脏的时,我们总是显示 0{40} 表示它是脏的,我们不知道对象是什么那个东西的名字是,直到你真正运行 git-update-index(或 git-add)它"(到那时它就不会变脏了).
对于 blob(无论是常规文件还是符号链接),这样做的优点是不必运行 hash-object 来获取如果您实际执行 git-add 将创建的对象的对象名称.

When you compare something with a work tree state, and when the work tree state is dirty, we always show 0{40} to mean "it is dirty and we do not know what the object name of that thing is, until you actuallly run git-update-index (or git-add) it" (and at that point it would stop being dirty).
For blobs (be it a regular file or a symbolic link), this has an advantage of not having to run hash-object to obtain the object name of an object that would be created if you actually did git-add it.

当我们检查它是否脏时,我们已经做了一个 lstat(2) 并且知道类型它,所以我们可以显示模式位.所以你会看到 100644、100755 或120000 为 blob.对于子模块也是如此.

When we check if it is dirty, we already do an lstat(2) and know the type of it, so we can show the mode bits. So you will see 100644, 100755 or 120000 for blobs. Similarly for a submodule.

对于子模块,我们可以从 $sub/.git/HEAD 读取值,但在工作树侧(通常是右侧,除非您使用 -R)显示 0{40} 更一致.

For a submodule, we could read the value from $sub/.git/HEAD, but it is more consistent to show 0{40} on the work tree side (typically the right hand side, unless you use -R).

所以检查你是否有 .git/modules/asubmodule/HEAD.
或者尝试清理您的子模块条目,然后将该子模块重新声明为 eagle-vision url.

So check if you have a .git/modules/asubmodule/HEAD.
Or try to cleanup your submodule entry, and then redeclare that submodule to eagle-vision url.

但是您丢失的树可能与该条目无关.

But your missing tree might not be related to that entry though.

这篇关于Eclipse 中的 Egit 缺失树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆