Browse Source

Repository: fix reference comparison of Files

Change-Id: Ib46ea2c0d5039c88b4fc59723135c503a8c950ce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
400bfd6665
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

3
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

@ -1541,8 +1541,9 @@ public abstract class Repository implements AutoCloseable {
!filePath.startsWith(workDirPath)) {
File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile();
File absFile = file.isAbsolute() ? file : file.getAbsoluteFile();
if (absWd == workDir && absFile == file)
if (absWd.equals(workDir) && absFile.equals(file)) {
return ""; //$NON-NLS-1$
}
return stripWorkDir(absWd, absFile);
}

Loading…
Cancel
Save