diff options
-rw-r--r-- | org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java index 58e36e2f0f..9621003b72 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java @@ -114,9 +114,13 @@ class GitResourceVariantComparator implements IResourceVariantComparator { return ((IFile) resource).getContents(); else try { - if (resource.getType() == IResource.FILE) - return ((IFile) resource).getContents(); - else + if (resource.getType() == IResource.FILE) { + IFile file = ((IFile) resource); + if (!file.isSynchronized(0)) + file.refreshLocal(0, null); + + return file.getContents(); + } else return new ByteArrayInputStream(null); } catch (TeamException e) { throw new CoreException(e.getStatus()); |