Community
Participate
Working Groups
Build Identifier: 1.1.0.201108090444 When drag-and-drop-ing (dnd) (aka move) a package to another project, and source project is on egit rcs, you will lose that package (ie. gets deleted and is not copied on destination). The destination project can (or not) be on egit too. The result is the same in both cases. Recovery: the package (when dirty) can be restored from eclipse Local History(right click, then Restore from Local History), or from previous commit (if not dirty)(right click, then Replace With->Commit). EGIT used(latest I from nightly I believe): Eclipse EGit 1.1.0.201108090444 org.eclipse.egit.feature.group Eclipse EGit Eclipse JGit 1.1.0.201108052218 org.eclipse.jgit.feature.group Eclipse JGit Eclipse used: Eclipse SDK Version: 4.1.0 Build id: I20110805-1200 m2e and svn were also installed but likely have no effect. Reproducible: Always Steps to Reproduce: 1. make 2 projects, put one of them(the source project for the dnd) on egit 2. make a package with a java class 3. move that package to the second project's source folder via drag and drop did you say goodbye to the package yet? no worries, Undo is disabled too ;) Workaround 1: right click on project, Team->Disconnect do the dnd right click on project, Team->Share Project, choose Git, ->Next, tick [x] Use or create repository in parent folder of project click Finish Workaround 2: Ctrl+C (copy) on package, then Ctrl+V (paste) on second project's source folder. Then delete package in first project. Note that Ctrl+X (cut) doesn't work - is disabled.
I cannot seem to reproduce this 100% but seem to get it about half the time when I try it.
This is caused by an incorrect implementation of the IMoveDeleteHook interface's moveFolder(*) method in EGit's GitMoveDeleteHook. The hook claims that it has successfully moved the folder (by returning 'true') but it actually only moves the folder if both the source and destination folders are in the same Git repository. JDT detects that the source folder still exists and proceeds to clean up the folder by deleting its content.
Fix proposed at http://egit.eclipse.org/r/4003
merged as http://egit.eclipse.org/w/?p=egit.git;a=commit;h=389d7c558716e76af681e1249f3883032fdeebed