Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberResourceMappingContextTest.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncInfo.java32
2 files changed, 5 insertions, 31 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberResourceMappingContextTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberResourceMappingContextTest.java
index 6e090f2b0..ba49e7546 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberResourceMappingContextTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitSubscriberResourceMappingContextTest.java
@@ -387,9 +387,9 @@ public class GitSubscriberResourceMappingContextTest extends GitTestCase {
assertTrue(hasFile1);
assertFalse(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
- assertTrue(
+ assertFalse(
context.hasLocalChange(subfolder, new NullProgressMonitor()));
- assertTrue(context.hasLocalChange(sub, new NullProgressMonitor()));
+ assertFalse(context.hasLocalChange(sub, new NullProgressMonitor()));
}
private RevCommit setContentsAndCommit(IFile targetFile,
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncInfo.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncInfo.java
index 4900301cf..e3cad7165 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncInfo.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSyncInfo.java
@@ -10,8 +10,6 @@ package org.eclipse.egit.core.synchronize;
import static org.eclipse.jgit.lib.Repository.stripWorkDir;
-import java.util.Collection;
-
import org.eclipse.core.resources.IResource;
import org.eclipse.egit.core.synchronize.ThreeWayDiffEntry.ChangeType;
import org.eclipse.egit.core.synchronize.ThreeWayDiffEntry.Direction;
@@ -54,10 +52,9 @@ class GitSyncInfo extends SyncInfo {
return IN_SYNC;
if (obj.getDiffEntry().isTree()) {
- // Check that we do have at least one descendant that is a file
- if (!hasNonSyncFile(obj)) {
- return IN_SYNC;
- }
+ // Folder state is not important for synchronization, and the state
+ // recorded in GitSyncObjCache is bogus anyway.
+ return IN_SYNC;
}
int direction;
Direction gitDirection = obj.getDiffEntry().getDirection();
@@ -80,29 +77,6 @@ class GitSyncInfo extends SyncInfo {
return IN_SYNC;
}
- private boolean hasNonSyncFile(GitSyncObjectCache obj) {
- Collection<GitSyncObjectCache> children = obj.members();
- if (children == null) {
- return false;
- }
- for (GitSyncObjectCache child : children) {
- if (!child.getDiffEntry().isTree()) {
- if (child.getDiffEntry()
- .getChangeType() != ThreeWayDiffEntry.ChangeType.IN_SYNC) {
- return true;
- }
- }
- }
- for (GitSyncObjectCache child : children) {
- if (child.getDiffEntry().isTree()) {
- if (hasNonSyncFile(child)) {
- return true;
- }
- }
- }
- return false;
- }
-
@Override
public boolean equals(Object other) {
return super.equals(other);

Back to the top