From 96c5a1491c6d34c2f0f32deae3f7894519fd7830 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 13 Feb 2025 13:08:34 +0100 Subject: [PATCH] Fix retrieving apiurl from git repositories in get_api_url() in the command-line code --- osc/commandline.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 2f63bb96..b7439c25 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -873,9 +873,10 @@ class Osc(cmdln.Cmdln): print("Path.cwd() failed: ", e, file=sys.stderr) sys.exit(1) - if (is_package_dir(localdir) or is_project_dir(localdir)) and not self.options.apiurl: - return osc_store.Store(Path.cwd()).apiurl - else: + try: + store = osc_store.get_store(Path.cwd()) + return store.apiurl + except oscerr.NoWorkingCopy: return conf.config['apiurl'] def do_version(self, subcmd, opts):