From cf83c96ca297a9caf9a2015d978beabc3d33ee20 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Fri, 31 Jan 2025 17:48:07 +0100 Subject: [PATCH] IDEA-365609 "Share on GitHub" doesn't commit files properly save settings after git repo initialization to ensure vcs.xml is updated GitOrigin-RevId: 8429b81dc864ae2661569617a227f8973abb21dc --- .../org/jetbrains/plugins/github/GHShareProjectUtil.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/github/github-core/src/org/jetbrains/plugins/github/GHShareProjectUtil.kt b/plugins/github/github-core/src/org/jetbrains/plugins/github/GHShareProjectUtil.kt index 44cace538476..9047697455f9 100644 --- a/plugins/github/github-core/src/org/jetbrains/plugins/github/GHShareProjectUtil.kt +++ b/plugins/github/github-core/src/org/jetbrains/plugins/github/GHShareProjectUtil.kt @@ -76,9 +76,6 @@ object GHShareProjectUtil { root: VirtualFile, projectName: @NlsSafe String) { FileDocumentManager.getInstance().saveAllDocuments() - runWithModalProgressBlocking(project, IdeBundle.message("progress.saving.project", project.name)) { - saveSettings(project) - } val possibleRemotes = gitRepository ?.let(project.service()::findKnownRepositories) @@ -235,6 +232,12 @@ object GHShareProjectUtil { return true } + invokeAndWaitIfNeeded(indicator.modalityState) { + runWithModalProgressBlocking(project, IdeBundle.message("progress.saving.project", project.name)) { + saveSettings(project, forceSavingAllSettings = true) + } + } + LOG.info("Trying to commit") try { LOG.info("Adding files for commit")