Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2018-05-13 15:00:12 -0400
committerMatthias Sohn2018-05-13 16:18:05 -0400
commit477962a039498dc7dfa8b2919fe6fd6fb8a78d6c (patch)
treedf8de976551588eec246e688149e398d7a6608e5 /org.eclipse.egit.ui/src/org/eclipse/egit/ui
parentc3c3e0fb5f9185955ae6af597e8662fb49e60c8e (diff)
downloadegit-477962a039498dc7dfa8b2919fe6fd6fb8a78d6c.tar.gz
egit-477962a039498dc7dfa8b2919fe6fd6fb8a78d6c.tar.xz
egit-477962a039498dc7dfa8b2919fe6fd6fb8a78d6c.zip
Ignore IndexChangedEvent if it originates from the same JGit process
Repository.scanForRepoChanges() fires an IndexChangedEvent when the index file was modified. Since JGit now fires fine grained WorkingTreeModifiedEven indicating exactly which files have been changed we should only handle IndexChangedEvents originating from external git commands in order to avoid double processing. Change-Id: Id28c26b5fe08c0466ae8680c7385cfa0901ae4e6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui')
-rwxr-xr-xorg.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java2
3 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 5613a5894..0c08cb47c 100755
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -844,6 +844,9 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
private final RepositoryCache repositoryCache;
private final IndexChangedListener listener = event -> {
+ if (event.isInternal()) {
+ return;
+ }
Repository repository = event.getRepository();
if (repository.isBare()) {
return;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
index 967c135b9..42bc21581 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
@@ -258,7 +258,7 @@ public class RemoveCommand extends
&& node.getParent().getType() == RepositoryTreeNodeType.SUBMODULES) {
FileUtils.delete(workTree, FileUtils.RECURSIVE
| FileUtils.RETRY | FileUtils.SKIP_MISSING);
- node.getParent().getRepository().notifyIndexChanged();
+ node.getParent().getRepository().notifyIndexChanged(true);
}
// Delete if empty working directory
String[] files = workTree.list();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java
index 6273d9308..4c2754444 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java
@@ -265,7 +265,7 @@ public class LocalNonWorkspaceTypedElement extends LocalResourceTypedElement {
if (!updated) {
RepositoryMapping mapping = RepositoryMapping.getMapping(path);
if (mapping != null) {
- mapping.getRepository().fireEvent(new IndexChangedEvent());
+ mapping.getRepository().fireEvent(new IndexChangedEvent(true));
}
}
}

Back to the top