Prevent NPE when comparing an untracked file with the index
commit0c47dcbd35cae80f9a54847fbc17f49c2b65f65a
authorRemy Suen <remysuen@ca.ibm.com>
Mon, 17 May 2010 10:13:02 +0000 (17 06:13 -0400)
committerRemy Suen <remysuen@ca.ibm.com>
Mon, 17 May 2010 10:13:02 +0000 (17 06:13 -0400)
treee1b6312dec599cbbaac718e314358630910d0fd8
parent856f4028793ccdacd09b4130ab944eb6741aa93d
Prevent NPE when comparing an untracked file with the index

The compare request does not currently check whether a file is in
the index before displaying the compare editor. This causes
problems when the editor tries to ask the revision for its content
and JGit is unable to return something meaningful here because a
blob cannot actually be found. The fix is to check if an entry
actually exists in the index before trying to create a compare
editor input from it.

Change-Id: I9a1b8bd39aded3dcdeaf523b735f5fcf66f8d152
org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexAction.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties