summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Duft2012-09-17 01:57:47 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-01-25 20:03:47 (EST)
commit436c4d907b3cdd58461251befad054a88c1ae7cb (patch)
tree027a6351f37a032f2653c3d14d6b334a58b83d6e
parent26cb30e844d66c67311fb39d6e42a5ec56541717 (diff)
downloadegit-436c4d907b3cdd58461251befad054a88c1ae7cb.zip
egit-436c4d907b3cdd58461251befad054a88c1ae7cb.tar.gz
egit-436c4d907b3cdd58461251befad054a88c1ae7cb.tar.bz2
Only refresh projects with changed resourcesrefs/changes/23/5323/21
This change relies on a JGit change which introduces the passing of modified files to CheckoutCommand. The BranchOperation can now match the modified file list against valid projects, and refresh only those containing changed resources. JGit-Dependency: I53c50ee09bc0d3ff501bdc25196e52e739c3f1f9 Change-Id: If43a04410492ee6976f00d18d99c7b0a935c0689
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index fb22f6b..d60424e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -105,9 +105,8 @@ public class BranchOperation extends BaseOperation {
public void run(IProgressMonitor pm) throws CoreException {
preExecute(pm);
- IProject[] validProjects = ProjectUtil
- .getValidOpenProjects(repository);
- IProject[] missing = getMissingProjects(target, validProjects);
+ IProject[] missing = getMissingProjects(target, ProjectUtil
+ .getValidOpenProjects(repository));
pm.beginTask(NLS.bind(
CoreText.BranchOperation_performingBranch, target),
@@ -143,7 +142,14 @@ public class BranchOperation extends BaseOperation {
if (result.getStatus() == Status.NONDELETED)
retryDelete(result.getUndeletedList());
pm.worked(1);
- ProjectUtil.refreshValidProjects(validProjects, delete,
+
+ List<String> pathsToHandle = new ArrayList<String>();
+ pathsToHandle.addAll(co.getResult().getModifiedList());
+ pathsToHandle.addAll(co.getResult().getRemovedList());
+ pathsToHandle.addAll(co.getResult().getConflictList());
+ IProject[] refreshProjects = ProjectUtil
+ .getProjectsContaining(repository, pathsToHandle);
+ ProjectUtil.refreshValidProjects(refreshProjects, delete,
new SubProgressMonitor(pm, 1));
pm.worked(1);