From fcd9de0e2913ed67178a84d8367e90003761ad77 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Fri, 3 Jan 2025 16:44:12 +0100 Subject: [PATCH] IJPL-174576 git: try to fix outdated Editor content after interactive rebase GitOrigin-RevId: 85e618976c19f935b1f4233b287306ee3eff596c --- plugins/git4idea/src/git4idea/GitUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java index 3c48e0bed232..2d19e0054dd2 100644 --- a/plugins/git4idea/src/git4idea/GitUtil.java +++ b/plugins/git4idea/src/git4idea/GitUtil.java @@ -5,6 +5,7 @@ import com.intellij.dvcs.DvcsUtil; import com.intellij.dvcs.repo.RepoStateException; import com.intellij.dvcs.repo.Repository; import com.intellij.dvcs.repo.VcsRepositoryManager; +import com.intellij.ide.SaveAndSyncHandler; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.Task; @@ -960,6 +961,10 @@ public final class GitUtil { } else { RefreshVFsSynchronously.updateChanges(changes); + + // the file opened in the editor may accidentally capture an intermediate state for back-and-forth changes during rebase + // these may not be refreshed if 'before rebase' and 'after rebase' states match for the file + SaveAndSyncHandler.getInstance().refreshOpenFiles(); } }