mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
VCS keeps asking me to associate unknown file type
This commit is contained in:
@@ -131,7 +131,7 @@ public class FilePathImpl implements FilePath {
|
||||
return myFile.equals(((FilePath)o).getIOFile());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static boolean isSpecialName(final String name) {
|
||||
return ".".equals(name) || "..".equals(name);
|
||||
}
|
||||
@@ -214,6 +214,9 @@ public class FilePathImpl implements FilePath {
|
||||
if (myVirtualFile != null && !myVirtualFile.isValid()) {
|
||||
myVirtualFile = null;
|
||||
}
|
||||
if (myVirtualFile == null) {
|
||||
refresh();
|
||||
}
|
||||
detectFileType();
|
||||
return myVirtualFile;
|
||||
}
|
||||
@@ -251,10 +254,11 @@ public class FilePathImpl implements FilePath {
|
||||
@Override
|
||||
@Nullable
|
||||
public Document getDocument() {
|
||||
if (myVirtualFile == null || myVirtualFile.getFileType().isBinary()) {
|
||||
VirtualFile virtualFile = getVirtualFile();
|
||||
if (virtualFile == null || virtualFile.getFileType().isBinary()) {
|
||||
return null;
|
||||
}
|
||||
return FileDocumentManager.getInstance().getDocument(myVirtualFile);
|
||||
return FileDocumentManager.getInstance().getDocument(virtualFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -290,7 +294,8 @@ public class FilePathImpl implements FilePath {
|
||||
|
||||
@Override
|
||||
public FileType getFileType() {
|
||||
return myVirtualFile != null ? myVirtualFile.getFileType() : FileTypeManager.getInstance().getFileTypeByFileName(myFile.getName());
|
||||
VirtualFile virtualFile = getVirtualFile();
|
||||
return virtualFile != null ? virtualFile.getFileType() : FileTypeManager.getInstance().getFileTypeByFileName(myFile.getName());
|
||||
}
|
||||
|
||||
public static FilePathImpl create(VirtualFile file) {
|
||||
|
||||
+3
-2
@@ -75,8 +75,9 @@ public class ConflictedDiffRequestPresentable implements DiffRequestPresentable
|
||||
return new MyResult(request, DiffPresentationReturnValue.useRequest);
|
||||
|
||||
} else {
|
||||
if (myFile.getFileType().isBinary()) {
|
||||
final boolean nowItIsText = ChangeDiffRequestPresentable.checkAssociate(myProject, new FilePathImpl(myFile), context);
|
||||
FilePathImpl filePath = new FilePathImpl(myFile);
|
||||
if (filePath.getFileType().isBinary()) {
|
||||
final boolean nowItIsText = ChangeDiffRequestPresentable.checkAssociate(myProject, filePath, context);
|
||||
if (! nowItIsText) {
|
||||
return createErrorResult();
|
||||
}
|
||||
|
||||
+3
-2
@@ -44,8 +44,9 @@ public class MergedDiffRequestPresentable implements DiffRequestPresentable {
|
||||
}
|
||||
|
||||
public MyResult step(DiffChainContext context) {
|
||||
if (myFile.getFileType().isBinary()) {
|
||||
final boolean nowItIsText = ChangeDiffRequestPresentable.checkAssociate(myProject, new FilePathImpl(myFile), context);
|
||||
FilePathImpl filePath = new FilePathImpl(myFile);
|
||||
if (filePath.getFileType().isBinary()) {
|
||||
final boolean nowItIsText = ChangeDiffRequestPresentable.checkAssociate(myProject, filePath, context);
|
||||
if (! nowItIsText) {
|
||||
final SimpleDiffRequest request = new SimpleDiffRequest(myProject, null);
|
||||
return new MyResult(request, DiffPresentationReturnValue.removeFromList);
|
||||
|
||||
Reference in New Issue
Block a user