Skip to content

Commit 7a91139

Browse files
authored
Merge pull request openSUSE#1946 from dmach/git-store-osc-allow-scmurl
Make scmsync (scmurl) packages work again with git commands
2 parents c112429 + 4ee2e0b commit 7a91139

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

behave/features/osc-commands-unsupported-git.feature

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,6 @@ Scenario: Run 'osc status'
285285
"""
286286

287287

288-
Scenario: Run 'osc submitrequest'
289-
When I execute osc with args "submitrequest"
290-
Then the exit code is 1
291-
And stderr is
292-
"""
293-
Command 'osc submitrequest' is not supported with git. Use 'git-obs pr create' instead.
294-
"""
295-
296-
297288
Scenario: Run 'osc update'
298289
When I execute osc with args "update"
299290
Then the exit code is 1

osc/commandline.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,10 +2003,6 @@ def do_submitrequest(self, subcmd, opts, *args):
20032003
from .core import store_read_project
20042004
from .store import git_is_unsupported
20052005

2006-
if len(args) <= 2:
2007-
msg = f"Command 'osc {subcmd}' is not supported with git. Use 'git-obs pr create' instead."
2008-
git_is_unsupported(".", msg)
2009-
20102006
def _check_service(root):
20112007
serviceinfo = root.find('serviceinfo')
20122008
if serviceinfo is not None:

osc/git_scm/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __init__(self, path: str, *, check: bool = True):
111111
self._git = Git(path)
112112
self._check = check
113113

114-
if not self._git.topdir:
114+
if not os.path.isdir(self.abspath) or not self._git.topdir:
115115
msg = f"Directory '{path}' is not a Git SCM working copy"
116116
raise oscerr.NoWorkingCopy(msg)
117117

osc/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ def git_is_unsupported(path: str, msg: str):
5656
# not a working copy, we're not handling it
5757
return
5858

59-
if isinstance(store, git_scm.GitStore) or store.scmurl:
59+
if isinstance(store, git_scm.GitStore) or (store.is_project and store.scmurl):
6060
raise oscerr.NoWorkingCopy(msg)

0 commit comments

Comments
 (0)