diff options
author | Thomas Wolf | 2015-11-22 17:34:45 +0000 |
---|---|---|
committer | Thomas Wolf | 2015-11-22 18:09:26 +0000 |
commit | 762037b3eb2951ee36f223f66c633a503bf00b51 (patch) | |
tree | 9ccfb1f9131ee7807b500bd7dd4bebd4b1fed6ec | |
parent | e17358d4905c6a814624afd3afd5e4be50411c2d (diff) | |
download | egit-762037b3eb2951ee36f223f66c633a503bf00b51.tar.gz egit-762037b3eb2951ee36f223f66c633a503bf00b51.tar.xz egit-762037b3eb2951ee36f223f66c633a503bf00b51.zip |
Fix a FindBugs warning.
String.equals(IPath) won't work as expected.
Change-Id: I38e7ecd7977d8e3425af198316493793a16db0da
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r-- | org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java | 3 | ||||
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java index e4aaa5dc7e..7abe03af8f 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java @@ -600,7 +600,8 @@ public class RepositoryUtil { .makeRelativeTo( new Path(repository.getWorkTree().getAbsolutePath())) .toString(); - if (repoRelativePath.length() == 0 || repoRelativePath.equals(path)) { + if (repoRelativePath.length() == 0 + || repoRelativePath.equals(path.toString())) { return false; } try (TreeWalk walk = new TreeWalk(repository)) { 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 7398accc9f..bc38aa9d45 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 @@ -170,7 +170,8 @@ public class CompareIndexWithHeadActionHandler extends RepositoryActionHandler { IPath workDir = new Path(repository.getWorkTree().getAbsolutePath()); String resRelPath = location.makeRelativeTo(workDir).toString(); // This action at the moment only works for files anyway - if (resRelPath.length() == 0 || resRelPath.equals(location)) { + if (resRelPath.length() == 0 + || resRelPath.equals(location.toString())) { return false; } |