[vcs-log] fix recreating log after reloading mappings from disk

When vcs mappings are changed on disk, ProjectLevelVcsManager.readDirectoryMappings first clears the old mappings completely. This triggers VCS_CONFIGURATION_CHANGED event. Then new mappings are set, which triggers the event again. So recreateLog is called twice, the first time it just disposes the old log, the second it should create a new one.

The issue was that the callback creating a new log was only called if an old log was present (after disposing it). Which led to new log not being created. Fix is to always invoke the callback.
This commit is contained in:
Julia Beliaeva
2018-04-16 18:22:21 +03:00
parent 9a022b8e73
commit bfa074babe
@@ -180,8 +180,11 @@ public class VcsProjectLog implements Disposable {
if (myValue != null) {
myMessageBus.syncPublisher(VCS_PROJECT_LOG_CHANGED).logDisposed(myValue);
myValue.dispose(callback);
myValue = null;
}
else if (callback != null) {
ApplicationManager.getApplication().executeOnPooledThread(callback);
}
myValue = null;
}
@Nullable