From 2aa9f2a820ed21c1b627a77ee7f928f13961af5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20R=C4=99bacz?= Date: Mon, 15 Sep 2025 19:33:28 +0200 Subject: [PATCH] Ide: show git errors when update of UppHub packages failed (#297) --- uppsrc/ide/UppHub.cpp | 16 ++++++++++++++-- uppsrc/ide/urepo.h | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/uppsrc/ide/UppHub.cpp b/uppsrc/ide/UppHub.cpp index 5b5ad7a9d..b91539c3d 100644 --- a/uppsrc/ide/UppHub.cpp +++ b/uppsrc/ide/UppHub.cpp @@ -540,11 +540,23 @@ void UppHubDlg::Update() if(!PromptYesNo("Pull updates for all modules?")) return; UrepoConsole console; + + int errors = 0; for(const UppHubNest& n : upv) { String dir = GetHubDir() + "/" + n.name; - if(DirectoryExists(dir)) - console.Git(dir, "pull --rebase"); + if(!DirectoryExists(dir)) + continue; + + if(console.Git(dir, "pull --rebase") != 0) + ++errors; } + if(errors == 0) + return; + + ErrorOK( + Format("Update failed (%d errors). Review the logs to diagnose and resolve the issues.", + errors)); + console.Perform(); } void UppHubDlg::Install(const Index& ii_) diff --git a/uppsrc/ide/urepo.h b/uppsrc/ide/urepo.h index c765d6e9a..cb4e68ee1 100644 --- a/uppsrc/ide/urepo.h +++ b/uppsrc/ide/urepo.h @@ -2,8 +2,6 @@ #include class UrepoConsole : public WithUrepoConsoleLayout { - typedef UrepoConsole CLASSNAME; - Font font; void AddResult(const String& out); bool canceled = false;