Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2011-02-08 18:12:12 -0500
committerMatthias Sohn2011-02-08 18:12:12 -0500
commitc563d5161304f968b577f28577a103deeb25194d (patch)
treef5d667ad8ce27cde6ebda8775195a1c933b69284
parentf4a7d9db70f042537fcf451c47543bc5c09dff04 (diff)
downloadegit-c563d5161304f968b577f28577a103deeb25194d.tar.gz
egit-c563d5161304f968b577f28577a103deeb25194d.tar.xz
egit-c563d5161304f968b577f28577a103deeb25194d.zip
[sync] Don't show empty staged and working tree nodes
Staged and working tree nodes were shown even when there were no changes inside. With this change such situation shouldn't occur anymore. Change-Id: I26010a1df1abbcb051d2916761aac53718d12624 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
index cd8875d1b..5c605b258 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java
@@ -150,8 +150,14 @@ public class GitModelRepository extends GitModelObject {
}
if (includeLocal) {
- result.add(new GitModelCache(this, srcCommit));
- result.add(new GitModelWorkingTree(this, srcCommit));
+ GitModelCache gitModelCache = new GitModelCache(this, srcCommit);
+ if (gitModelCache.getChildren().length > 0)
+ result.add(gitModelCache);
+
+ GitModelWorkingTree gitModelWorkingTree = new GitModelWorkingTree(
+ this, srcCommit);
+ if (gitModelWorkingTree.getChildren().length > 0)
+ result.add(gitModelWorkingTree);
}
} catch (IOException e) {
Activator.logError(e.getMessage(), e);

Back to the top