diff options
author | Robin Stocker | 2013-05-18 11:32:05 +0000 |
---|---|---|
committer | Robin Stocker | 2013-05-18 11:35:02 +0000 |
commit | fba31ed7bb17b78cfefc347c2a1ce5c1ea1dc937 (patch) | |
tree | bd996274b7729c9d381c592c8363a943227efe68 | |
parent | 47ea039d0608ec694239ad1a0c661c6b6319bbe6 (diff) | |
download | egit-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
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; |