From 194b0bcdcd0df8e5abe6de98a166429a7901d279 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Tue, 7 Jun 2016 15:53:50 +0300 Subject: [PATCH] [patch]: style- rename field and change min common ancestor to be a directory --- .../vcs/changes/patch/CreatePatchConfigurationPanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/CreatePatchConfigurationPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/CreatePatchConfigurationPanel.java index a71cbb651620..e5bb0d631442 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/CreatePatchConfigurationPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/CreatePatchConfigurationPanel.java @@ -61,7 +61,7 @@ public class CreatePatchConfigurationPanel { private ComboBox myEncoding; private JLabel myWarningLabel; private final Project myProject; - @Nullable private File myCommonParentPath; + @Nullable private File myCommonParentDir; public CreatePatchConfigurationPanel(@NotNull final Project project) { myProject = project; @@ -126,7 +126,7 @@ public class CreatePatchConfigurationPanel { } public void setCommonParentPath(@Nullable File commonParentPath) { - myCommonParentPath = commonParentPath; + myCommonParentDir = commonParentPath == null || commonParentPath.isDirectory() ? commonParentPath : commonParentPath.getParentFile(); } private void checkExist() { @@ -168,8 +168,8 @@ public class CreatePatchConfigurationPanel { if (StringUtil.isEmptyOrSpaces(baseDirName)) return new ValidationInfo("Base path can't be empty!", myBasePathField); File baseFile = new File(baseDirName); if (!baseFile.exists()) return new ValidationInfo("Base dir doesn't exist", myBasePathField); - if (myCommonParentPath != null && !FileUtil.isAncestor(baseFile, myCommonParentPath, false)) { - return new ValidationInfo(String.format("Base path doesn't contain all selected changes (use %s)", myCommonParentPath.getPath()), + if (myCommonParentDir != null && !FileUtil.isAncestor(baseFile, myCommonParentDir, false)) { + return new ValidationInfo(String.format("Base path doesn't contain all selected changes (use %s)", myCommonParentDir.getPath()), myBasePathField); } return null;