From a6a76cc15a2c46a0741f88d3b794c407b314052a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 21 May 2025 16:19:38 +0200 Subject: just-mr: Fix wrong setup root being picked up This fixes a bug in which the setup root was falsely being changed by unconditionally searching early for a default configuration files, despite one being explicitly provided at the command line. --- src/other_tools/just_mr/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/other_tools/just_mr/main.cpp') diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp index f1836d23..aa1abc74 100644 --- a/src/other_tools/just_mr/main.cpp +++ b/src/other_tools/just_mr/main.cpp @@ -265,12 +265,17 @@ auto main(int argc, char* argv[]) -> int { } SetupLogging(arguments.log); + // Parse rc file, if given, and returns any configuration file found in + // known locations, with the setup root updated accordingly auto config_file = ReadJustMRRC(&arguments); // As the rc file can contain logging parameters, reset the logging // configuration SetupLogging(arguments.log); + // An explicitly given configuration file path wins. In this case, the + // default setup root must be used if (arguments.common.repository_config) { config_file = arguments.common.repository_config; + arguments.common.just_mr_paths->setup_root = kDefaultSetupRoot; } // if optional args were not read from just-mrrc or given by user, use -- cgit v1.2.3