diff --git a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/apply/ApplyTextFilePatch.java b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/apply/ApplyTextFilePatch.java index b7277ac2ea61..592c86806d02 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/apply/ApplyTextFilePatch.java +++ b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/apply/ApplyTextFilePatch.java @@ -38,7 +38,7 @@ public class ApplyTextFilePatch extends ApplyFilePatchBase { } @Nullable - protected Result applyChange(final Project project, final VirtualFile fileToPatch, final FilePath pathBeforeRename, final Getter baseContents) throws IOException { + protected Result applyChange(final Project project, final VirtualFile fileToPatch, final FilePath pathBeforeRename, @Nullable final Getter baseContents) throws IOException { byte[] fileContents = fileToPatch.contentsToByteArray(); CharSequence text = LoadTextUtil.getTextByBinaryPresentation(fileContents, fileToPatch); final GenericPatchApplier applier = new GenericPatchApplier(text, myPatch.getHunks()); 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 b5eb0d69815a..cad1917be8bd 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 @@ -28,6 +28,7 @@ import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -40,7 +41,7 @@ public class ApplyPatchForBaseRevisionTexts { @NotNull public static ApplyPatchForBaseRevisionTexts create(final Project project, final VirtualFile file, final FilePath pathBeforeRename, - final TextFilePatch patch, final Getter baseContents) { + final TextFilePatch patch, @Nullable final Getter baseContents) { assert ! patch.isNewFile(); final String beforeVersionId = patch.getBeforeVersionId(); DefaultPatchBaseVersionProvider provider = null; @@ -58,7 +59,7 @@ public class ApplyPatchForBaseRevisionTexts { final FilePath pathBeforeRename, final TextFilePatch patch, final VirtualFile file, - Getter baseContents) { + @Nullable Getter baseContents) { myWarnings = new ArrayList<>(); final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance(); Document document = fileDocumentManager.getDocument(file);