From feb6d05e474b32be3df795ff2e44621377926c4a Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 29 Nov 2018 16:54:59 +0300 Subject: [PATCH] git: change error notification for incoming, rename field --- .../branch/GitBranchIncomingOutgoingManager.java | 12 ++++++------ .../src/git4idea/ui/branch/GitBranchPopup.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java b/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java index 75e0f2d1dab1..c15b3a7ba824 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchIncomingOutgoingManager.java @@ -45,7 +45,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList //store map from local branch to related cached remote branch hash per repository @NotNull private final Map> myLocalBranchesToPull = newConcurrentMap(); @NotNull private final Map> myLocalBranchesToPush = newConcurrentMap(); - @NotNull private final MultiMap myAuthErrorMap = MultiMap.createConcurrentSet(); + @NotNull private final MultiMap myErrorMap = MultiMap.createConcurrentSet(); @NotNull private final Project myProject; @Nullable private ScheduledFuture myPeriodicalUpdater; @NotNull private final GitRepositoryManager myRepositoryManager; @@ -71,7 +71,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList } public boolean hasAuthenticationProblems() { - return !myAuthErrorMap.isEmpty(); + return !myErrorMap.isEmpty(); } public void startScheduling() { @@ -201,10 +201,10 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList if (lsRemoteResult.success()) { Map hashWithNameMap = map2MapNotNull(lsRemoteResult.getOutput(), GitRefUtil::parseRefsLine); result.putAll(getResolvedHashes(hashWithNameMap)); - myAuthErrorMap.remove(repository, remote); + myErrorMap.remove(repository, remote); } - else if (lsRemoteResult.isAuthenticationFailed()) { - myAuthErrorMap.putValue(repository, remote); + else { + myErrorMap.putValue(repository, remote); } }); return result; @@ -285,7 +285,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList @Override public void authenticationSucceeded(@NotNull GitRepository repository, @NotNull GitRemote remote) { - Collection remotes = myAuthErrorMap.get(repository); + Collection remotes = myErrorMap.get(repository); myAuthSuccessMap.putValue(repository, remote); if (remotes.contains(remote)) { MultiMap trackInfoByRemotes = groupTrackInfoByRemotes(repository); diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java index 70bc19590a63..2fe6fb99d1b7 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopup.java @@ -110,7 +110,7 @@ class GitBranchPopup extends DvcsBranchPopup { final GitBranchIncomingOutgoingManager gitBranchIncomingOutgoingManager = GitBranchIncomingOutgoingManager.getInstance(myProject); if (gitBranchIncomingOutgoingManager.hasAuthenticationProblems()) { AnAction updateBranchInfoWithAuthenticationAction = - new DumbAwareAction("Authentication failed. Click to retry", null, AllIcons.General.Warning) { + new DumbAwareAction("Update checks failed. Click to retry", null, AllIcons.General.Warning) { @Override public void actionPerformed(@NotNull AnActionEvent e) { gitBranchIncomingOutgoingManager.forceUpdateBranches(true);