Community
Participate
Working Groups
I was performing a rebase today. The rebase failed because EGit was not able to remove some files it wanted to remove. ---- org.eclipse.jgit.api.errors.JGitInternalException: Could not delete file T:\myfile.txt at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:274) at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:82) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326) at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:104) at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:115) at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.run(PullOperationUI.java:90) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Could not delete file T:\myfile.txt at org.eclipse.jgit.api.RebaseCommand.call(RebaseCommand.java:284) at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:265) ... 7 more Caused by: java.io.IOException: Could not delete file T:\myfile.txt at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:134) at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:92) at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:879) at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:427) at org.eclipse.jgit.api.RebaseCommand.abort(RebaseCommand.java:736) at org.eclipse.jgit.api.RebaseCommand.call(RebaseCommand.java:260) ... 8 more ---- This is unfortunate. I think that EGit should more graceful here. A dialog could be displayed which asks the user to close the file if it's still opened in an external process. Anyway, I wanted to resume/abort the rebase but I'm unable to perform any action. I always get "Cannot lock ... index" exception. ---- org.eclipse.jgit.api.errors.JGitInternalException: Cannot lock T:\.git\index at org.eclipse.jgit.api.RebaseCommand.call(RebaseCommand.java:204) at org.eclipse.egit.core.op.RebaseOperation$1.run(RebaseOperation.java:99) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326) at org.eclipse.egit.core.op.RebaseOperation.execute(RebaseOperation.java:112) at org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler$1.run(AbstractRebaseCommandHandler.java:62) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.io.IOException: Cannot lock T:\.git\index at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:188) at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:886) at org.eclipse.jgit.api.RebaseCommand.abort(RebaseCommand.java:732) at org.eclipse.jgit.api.RebaseCommand.call(RebaseCommand.java:202) ... 6 more ---- No matter what I do I always get this exception. I also restarted Eclipse several times but it didn't help.
To worksround the issue you can delete the lock file (index.lock). It is contained in the .git directory.
Fix proposed: http://egit.eclipse.org/r/3799
Fixed with commit eb46d7ffdc6dee1f8570d4be3b6c33cee8fa91c7