From 2ac0a804b1dff7f0e8290dfceacf0b17fd2f1056 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 7 Jun 2018 12:39:35 +0300 Subject: [PATCH] git: cleanup - inline methods --- .../branch/GitDeleteTagOperation.java | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java b/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java index 7d2eb632e817..4202a6eb7aa0 100644 --- a/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java +++ b/plugins/git4idea/src/git4idea/branch/GitDeleteTagOperation.java @@ -81,22 +81,6 @@ class GitDeleteTagOperation extends GitBranchOperation { myNotifier.notify(notification); } - @NotNull - private GitCompoundResult doRollback() { - GitCompoundResult result = new GitCompoundResult(myProject); - for (GitRepository repository : getSuccessfulRepositories()) { - GitCommandResult res = myGit.createNewTag(repository, myTagName, null, myDeletedTagTips.get(repository)); - result.append(repository, res); - repository.getRepositoryFiles().refresh(); - } - return result; - } - - @NotNull - private static String formatTagName(@NotNull String name) { - return "" + name + ""; - } - private void restoreInBackground(@NotNull Notification notification) { new Task.Backgroundable(myProject, "Restoring Tag " + myTagName + "...") { @Override @@ -107,12 +91,18 @@ class GitDeleteTagOperation extends GitBranchOperation { } private void rollbackTagDeletion(@NotNull Notification notification) { - GitCompoundResult result = doRollback(); + GitCompoundResult result = new GitCompoundResult(myProject); + for (GitRepository repository: getSuccessfulRepositories()) { + GitCommandResult res = myGit.createNewTag(repository, myTagName, null, myDeletedTagTips.get(repository)); + result.append(repository, res); + repository.getRepositoryFiles().refresh(); + } + if (result.totalSuccess()) { notification.expire(); } else { - myNotifier.notifyError("Couldn't Restore " + formatTagName(myTagName), result.getErrorOutputWithReposIndication()); + myNotifier.notifyError("Couldn't Restore " + myTagName + "", result.getErrorOutputWithReposIndication()); } }