From b55c8e11e6af8a57395bb1bd992d1aa18488f798 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 19 Jun 2015 18:55:34 +0300 Subject: [PATCH] [vcs] simplify: extract method --- .../diff/impl/patch/formove/PatchApplier.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java index c24f08bb5b58..00a853ec54bb 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java @@ -395,15 +395,11 @@ public class PatchApplier { new Consumer() { @Override public void consume(final VcsDirtyScopeManager vcsDirtyScopeManager) { - vcsDirtyScopeManager.filePathsDirty(directlyAffected, null); - vcsDirtyScopeManager.filesDirty(indirectlyAffected, null); + markDirty(vcsDirtyScopeManager, directlyAffected, indirectlyAffected); } }, null); } else { - final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(project); - // will schedule update - vcsDirtyScopeManager.filePathsDirty(directlyAffected, null); - vcsDirtyScopeManager.filesDirty(indirectlyAffected, null); + markDirty(VcsDirtyScopeManager.getInstance(project), directlyAffected, indirectlyAffected); if (context != null) { context.ping(); } @@ -412,6 +408,13 @@ public class PatchApplier { }); } + private static void markDirty(@NotNull VcsDirtyScopeManager vcsDirtyScopeManager, + @NotNull Collection directlyAffected, + @NotNull Collection indirectlyAffected) { + vcsDirtyScopeManager.filePathsDirty(directlyAffected, null); + vcsDirtyScopeManager.filesDirty(indirectlyAffected, null); + } + @Nullable private ApplyPatchStatus actualApply(final PathsVerifier verifier, final CommitContext commitContext) { final List> textPatches = verifier.getTextPatches();