git: cleanup - inline methods

This commit is contained in:
Aleksey Pivovarov
2018-06-07 12:49:53 +03:00
parent 41770253d8
commit 2ac0a804b1
@@ -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 "<b><code>" + name + "</code></b>";
}
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 <b><code>" + myTagName + "</code></b>", result.getErrorOutputWithReposIndication());
}
}