Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360141 - "IOException: Cannot lock [..]\.git\index" on hard reset after crash
Summary: "IOException: Cannot lock [..]\.git\index" on hard reset after crash
Status: CLOSED DUPLICATE of bug 339781
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Matthias Sohn CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 13:39 EDT by Markus Keller CLA
Modified: 2012-06-18 09:32 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-10-06 13:39:00 EDT
Eclipse 3.6.2
J/EGit 1.2.0.201110021920

After killing Eclipse in bug 360133, I cannot use "Team > Reset > Hard" any more, since I always get the error below.

I found bug 350677 comment #1:
> To worksround the issue you can delete the lock file (index.lock).
> It is contained in the .git directory.

This worked, but I shouldn't have to know that as an EGit user.


Error
Thu Oct 06 19:27:32 CEST 2011
mapping tree for commit

java.io.IOException: Cannot lock C:\e\w\R3_6_maintenance_Java7\git\eclipse.jdt.ui\.git\index
at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:193)
at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:239)
at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:896)
at org.eclipse.egit.core.op.ResetOperation.checkoutIndex(ResetOperation.java:246)
at org.eclipse.egit.core.op.ResetOperation.reset(ResetOperation.java:138)
at org.eclipse.egit.core.op.ResetOperation.access$0(ResetOperation.java:115)
at org.eclipse.egit.core.op.ResetOperation$1.run(ResetOperation.java:105)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.ResetOperation.execute(ResetOperation.java:109)
at org.eclipse.egit.core.internal.job.JobUtil$1.run(JobUtil.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Matthias Sohn CLA 2011-10-09 19:02:28 EDT
You are right, EGit should be more user friendly here and ask the user if he killed git earlier which may result in such a zombie index.lock file, and if he wants to remove this stale lock file.
Comment 2 Remy Suen CLA 2012-01-27 10:58:19 EST
Just got hit by this also.
Comment 3 Tomasz Zarna CLA 2012-06-18 08:34:04 EDT
Isn't it a dupe of bug 339781?
Comment 4 Markus Keller CLA 2012-06-18 09:32:34 EDT

*** This bug has been marked as a duplicate of bug 339781 ***