Patch Set 1: I would prefer that you didn't submit this

- when trying to unstage a staged deletion I hit this and Eclipse hangs

java.lang.IllegalArgumentException: Invalid mode 40000 for path org.eclipse.egit.core.test/build.properties
	at org.eclipse.jgit.dircache.DirCacheEntry.setFileMode(DirCacheEntry.java:476)
	at org.eclipse.egit.ui.internal.staging.StagingView$10.apply(StagingView.java:457)
	at org.eclipse.jgit.dircache.DirCacheEditor.applyEdits(DirCacheEditor.java:152)
	at org.eclipse.jgit.dircache.DirCacheEditor.finish(DirCacheEditor.java:122)
	at org.eclipse.jgit.dircache.BaseDirCacheEditor.commit(BaseDirCacheEditor.java:197)
	at org.eclipse.jgit.dircache.DirCacheEditor.commit(DirCacheEditor.java:117)
	at org.eclipse.egit.ui.internal.staging.StagingView.unstage(StagingView.java:474)
	at org.eclipse.egit.ui.internal.staging.StagingView.access$3(StagingView.java:406)
	at org.eclipse.egit.ui.internal.staging.StagingView$4.drop(StagingView.java:172)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
	at org.eclipse.swt.dnd.DropTarget.drop(DropTarget.java:715)
	at org.eclipse.swt.dnd.DropTarget.tableView_acceptDrop_row_dropOperation(DropTarget.java:946)
	at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:462)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.dnd.DropTarget.dndCallSuper(DropTarget.java:197)
	at org.eclipse.swt.dnd.DropTarget.performDragOperation(DropTarget.java:726)
	at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:443)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1025)
	at org.eclipse.swt.widgets.Table.mouseDownSuper(Table.java:1936)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1021)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2258)
	at org.eclipse.swt.widgets.Table.mouseDown(Table.java:1909)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1943)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2025)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5040)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4582)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4659)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3274)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

- when staging an untracked file unstaging it again works properly 

- when trying to unstage a staged modified file I end up with a staged 
   deletion and an untracked file for this file path (also confirmed with
   native git)

- I think the stage() and unstage() methods should have unit tests (maybe these methods should be also moved to egit.core)