mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] IDEA-89452 "File" or "Folder"
This commit is contained in:
@@ -855,4 +855,14 @@ public class GitUtil {
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String fileOrFolder(@NotNull VirtualFile file) {
|
||||
if (file.isDirectory()) {
|
||||
return "Folder";
|
||||
}
|
||||
else {
|
||||
return "File";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,9 +209,10 @@ public class GitCompareWithBranchAction extends DumbAwareAction {
|
||||
new GitDiffFromHistoryHandler(project).showDiffForTwo(new FilePathImpl(file), compareRevision, currentRevision);
|
||||
}
|
||||
|
||||
private static void fileDoesntExistInBranchError(Project project, VirtualFile file, String branchToCompare) {
|
||||
GitUIUtil.notifyMessage(project, "File doesn't exist in branch",
|
||||
String.format("File <code>%s</code> doesn't exist in branch <code>%s</code>", file.getPresentableUrl(), branchToCompare),
|
||||
private static void fileDoesntExistInBranchError(@NotNull Project project, @NotNull VirtualFile file, @NotNull String branchToCompare) {
|
||||
GitUIUtil.notifyMessage(project, GitUtil.fileOrFolder(file) + " doesn't exist in branch",
|
||||
String.format("%s <code>%s</code> doesn't exist in branch <code>%s</code>",
|
||||
GitUtil.fileOrFolder(file), file.getPresentableUrl(), branchToCompare),
|
||||
NotificationType.WARNING, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user