diff options
| author | Dariusz Luksza | 2010-08-17 23:02:34 +0000 |
|---|---|---|
| committer | Dariusz Luksza | 2010-08-17 23:02:34 +0000 |
| commit | ff9cd3ac74239740e518b894948074e68cc7f71b (patch) | |
| tree | 7aac5b11514ffe849398b64c9e4254c9861e2c13 | |
| parent | 3de56fcdfcdb5fed1392d5bc5ff9c44e25b2d0f1 (diff) | |
| download | egit-ff9cd3ac74239740e518b894948074e68cc7f71b.tar.gz egit-ff9cd3ac74239740e518b894948074e68cc7f71b.tar.xz egit-ff9cd3ac74239740e518b894948074e68cc7f71b.zip | |
Fix for out of sync exception
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.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()); |
