void (@NotNull Project project, @NotNull GitRepository repository, @NotNull @NlsSafe String reference) { String name = Messages.showInputDialog(project, GitBundle.message("git.new.tag.dialog.tag.name.label"), GitBundle.message("git.new.tag.dialog.title", reference), Messages.getQuestionIcon(), "", new InputValidator() { @Override public boolean checkInput(String inputString) { return !StringUtil.isEmpty(inputString) && !StringUtil.containsWhitespaces(inputString); } @Override public boolean canClose(String inputString) { return !StringUtil.isEmpty(inputString) && !StringUtil.containsWhitespaces(inputString); } }); if (name != null) { GitBrancher.getInstance(project).createNewTag(name, reference, Collections.singletonList(repository), null); } }