diff options
| author | Markus Duft | 2012-09-17 05:57:47 +0000 |
|---|---|---|
| committer | Gerrit Code Review @ Eclipse.org | 2013-01-26 01:03:47 +0000 |
| commit | 436c4d907b3cdd58461251befad054a88c1ae7cb (patch) | |
| tree | 027a6351f37a032f2653c3d14d6b334a58b83d6e | |
| parent | 26cb30e844d66c67311fb39d6e42a5ec56541717 (diff) | |
| download | egit-436c4d907b3cdd58461251befad054a88c1ae7cb.tar.gz egit-436c4d907b3cdd58461251befad054a88c1ae7cb.tar.xz egit-436c4d907b3cdd58461251befad054a88c1ae7cb.zip | |
Only refresh projects with changed resources
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.java | 14 |
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 fb22f6bdda..d60424e1ed 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); |
