From ae16d8be16e4104eaab130b0f1e18883e22bf742 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 5 Mar 2024 18:02:53 +0100 Subject: just-mr fetch: Correctly report if no fetch required --- src/other_tools/just_mr/fetch.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/other_tools/just_mr/fetch.cpp') diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index 8f3ae800..0dfb6c8a 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -377,11 +377,16 @@ auto MultiRepoFetch(std::shared_ptr const& config, auto str_a = fmt::format("{} {}", nr_a, nr_a == 1 ? "archive" : "archives"); auto str_gt = fmt::format("{} git {}", nr_gt, nr_gt == 1 ? "tree" : "trees"); - Logger::Log(LogLevel::Info, - "Found {}{}{} to fetch", - nr_a != 0 ? str_a : std::string(), - nr_a != 0 and nr_gt != 0 ? " and " : "", - nr_gt != 0 ? str_gt : std::string()); + auto fetchables = fmt::format("{}{}{}", + nr_a != 0 ? str_a : std::string(), + nr_a != 0 and nr_gt != 0 ? " and " : "", + nr_gt != 0 ? str_gt : std::string()); + if (fetchables.empty()) { + Logger::Log(LogLevel::Info, "No fetch required"); + } + else { + Logger::Log(LogLevel::Info, "Found {} to fetch", fetchables); + } // setup the APIs for archive fetches; only happens if in native mode auto remote_api = -- cgit v1.2.3