Skip to content

Commit

Permalink
Fix 'build' command when '--alternative-project' option is specified …
Browse files Browse the repository at this point in the history
…and the git branch cannot be mapped to a project
  • Loading branch information
dmach committed Aug 23, 2023
1 parent fa8da38 commit a0d4889
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions osc/commandline.py
Expand Up @@ -7232,8 +7232,12 @@ def do_build(self, subcmd, opts, *args):
store = osc_store.get_store(Path.cwd(), print_warnings=True)
store.assert_is_package()

if opts.alternative_project == store.project:
opts.alternative_project = None
try:
if opts.alternative_project and opts.alternative_project == store.project:
opts.alternative_project = None
except RuntimeError:

Check warning on line 7238 in osc/commandline.py

View check run for this annotation

Codecov / codecov/patch

osc/commandline.py#L7235-L7238

Added lines #L7235 - L7238 were not covered by tests
# ignore the following exception: Couldn't map git branch '<BRANCH>' to a project
pass

Check warning on line 7240 in osc/commandline.py

View check run for this annotation

Codecov / codecov/patch

osc/commandline.py#L7240

Added line #L7240 was not covered by tests

# HACK: avoid calling some underlying store_*() functions from parse_repoarchdescr() method
# We'll fix parse_repoarchdescr() later because it requires a larger change
Expand Down

0 comments on commit a0d4889

Please sign in to comment.