diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchForBaseRevisionTexts.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchForBaseRevisionTexts.java index cad1917be8bd..02fc9ed8b8e5 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchForBaseRevisionTexts.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchForBaseRevisionTexts.java @@ -70,6 +70,18 @@ public class ApplyPatchForBaseRevisionTexts { final List hunks = patch.getHunks(); + CharSequence contents = baseContents != null ? baseContents.get() : null; + if (contents != null) { + contents = StringUtil.convertLineSeparators(contents.toString()); + myBase = contents; + final GenericPatchApplier applier = new GenericPatchApplier(contents, hunks); + if (!applier.execute()) { + applier.trySolveSomehow(); + } + setPatched(applier.getAfter()); + return; + } + if (provider != null) { try { provider.getBaseVersionContent(pathBeforeRename, text -> { @@ -88,18 +100,6 @@ public class ApplyPatchForBaseRevisionTexts { if (myPatched != null) return; } - CharSequence contents = baseContents.get(); - if (contents != null) { - contents = StringUtil.convertLineSeparators(contents.toString()); - myBase = contents; - final GenericPatchApplier applier = new GenericPatchApplier(contents, hunks); - if (! applier.execute()) { - applier.trySolveSomehow(); - } - setPatched(applier.getAfter()); - return; - } - final GenericPatchApplier applier = new GenericPatchApplier(myLocal, hunks); if (! applier.execute()) { applier.trySolveSomehow();