1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-21 17:52:14 +01:00

Fix retrieving apiurl from git repositories in get_api_url() in the command-line code

This commit is contained in:
Daniel Mach 2025-02-13 13:08:34 +01:00
parent 0b4f39448d
commit 96c5a1491c

View File

@ -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):