aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2010-08-17 19:02:34 (EDT)
committerDariusz Luksza2010-08-17 19:02:34 (EDT)
commitff9cd3ac74239740e518b894948074e68cc7f71b (patch)
tree7aac5b11514ffe849398b64c9e4254c9861e2c13
parent3de56fcdfcdb5fed1392d5bc5ff9c44e25b2d0f1 (diff)
downloadegit-ff9cd3ac74239740e518b894948074e68cc7f71b.zip
egit-ff9cd3ac74239740e518b894948074e68cc7f71b.tar.gz
egit-ff9cd3ac74239740e518b894948074e68cc7f71b.tar.bz2
Fix for out of sync exceptionrefs/changes/27/1327/1
Synchronization seams to throw 'ResourceException: out of sync' while synchronizing not resources that are not in sync. I've added additional condition checking that resource is up to date, if not it will be refreshed. Bug: 322922 Change-Id: I2d31c7c508a20176a4719b4994d1b907412e3ce5 Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparator.java10
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 58e36e2..9621003 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());