git: change error notification for incoming, rename field

This commit is contained in:
Nadya Zabrodina
2018-12-17 18:49:11 +03:00
parent 30fab3cd6f
commit feb6d05e47
2 changed files with 7 additions and 7 deletions
@@ -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<GitRepository, Map<GitLocalBranch, Hash>> myLocalBranchesToPull = newConcurrentMap();
@NotNull private final Map<GitRepository, Map<GitLocalBranch, Hash>> myLocalBranchesToPush = newConcurrentMap();
@NotNull private final MultiMap<GitRepository, GitRemote> myAuthErrorMap = MultiMap.createConcurrentSet();
@NotNull private final MultiMap<GitRepository, GitRemote> 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<String, String> 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<GitRemote> remotes = myAuthErrorMap.get(repository);
Collection<GitRemote> remotes = myErrorMap.get(repository);
myAuthSuccessMap.putValue(repository, remote);
if (remotes.contains(remote)) {
MultiMap<GitRemote, GitBranchTrackInfo> trackInfoByRemotes = groupTrackInfoByRemotes(repository);
@@ -110,7 +110,7 @@ class GitBranchPopup extends DvcsBranchPopup<GitRepository> {
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);