Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2013-05-18 11:32:05 +0000
committerRobin Stocker2013-05-18 11:35:02 +0000
commitfba31ed7bb17b78cfefc347c2a1ce5c1ea1dc937 (patch)
treebd996274b7729c9d381c592c8363a943227efe68
parent47ea039d0608ec694239ad1a0c661c6b6319bbe6 (diff)
downloadegit-fba31ed7bb17b78cfefc347c2a1ce5c1ea1dc937.tar.gz
egit-fba31ed7bb17b78cfefc347c2a1ce5c1ea1dc937.tar.xz
egit-fba31ed7bb17b78cfefc347c2a1ce5c1ea1dc937.zip
[stagingView] Fix comparing missing/removed file
A missing/removed file no longer exists on the file system. So instead of using isFile (which also checks existence), use !isDirectory. Change-Id: Ica88f981e846da61902088d123a21174748616ef
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
index c32c31e404..c4325f77db 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
@@ -88,7 +88,7 @@ public class CompareIndexWithHeadActionHandler extends RepositoryActionHandler {
return isStaged(repository, resource.getLocation());
} else {
IPath location = AdapterUtils.adapt(selection.getFirstElement(), IPath.class);
- if (location != null && location.toFile().isFile())
+ if (location != null && !location.toFile().isDirectory())
return isStaged(repository, location);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
index 5b53543da1..f1cbc608df 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
@@ -44,7 +44,7 @@ public class CompareWithIndexActionHandler extends RepositoryActionHandler {
return null;
final IPath[] locations = getSelectedLocations(event);
- if (locations.length == 1 && locations[0].toFile().isFile()) {
+ if (locations.length == 1 && !locations[0].toFile().isDirectory()) {
final IPath baseLocation = locations[0];
final ITypedElement base = getBaseTypeElement(baseLocation);
final ITypedElement next;

Back to the top