Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311051

Summary: Branch operation fails
Product: [Technology] EGit Reporter: Jens Baumgart <jens.baumgart>
Component: CoreAssignee: Jens Baumgart <jens.baumgart>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: matthias.sohn, remy.suen, stefan.lay
Version: unspecified   
Target Milestone: 0.9.0-M2   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Thread Dump none

Description Jens Baumgart CLA 2010-04-29 11:55:15 EDT
This problem is not always reproducable. You have to execute Team->branch multiple times very fast.

The branch operation fails with:

Caused by: java.io.IOException: Could not rename delete old index
	at org.eclipse.jgit.lib.GitIndex.write(GitIndex.java:296)
	at org.eclipse.egit.core.op.BranchOperation.writeIndex(BranchOperation.java:126)

I could reproduce the problem in the debugger (see attached stack trace). 
The problem is that GitIndex.write can not delete a file that is read by DirCache in the decorator thread.
Comment 1 Jens Baumgart CLA 2010-04-29 11:57:02 EDT
Created attachment 166510 [details]
Thread Dump
Comment 2 Remy Suen CLA 2010-05-05 18:42:10 EDT
Just hit this today. The error message should also be corrected as "Could not rename delete old index" doesn't make any sense.
Comment 3 Jens Baumgart CLA 2010-08-04 09:51:29 EDT
Fixed with http://egit.eclipse.org/r/#change,1152