void () { String currentBranch = ContainerUtil.getFirstItem(myCurrentHeads.values()); if (currentBranch != null) { ApplicationManager.getApplication().invokeLater(() -> { if (myProject.isDisposed()) return; myProject.getMessageBus().syncPublisher(BranchChangeListener.VCS_BRANCH_CHANGED).branchWillChange(currentBranch); }); } }