Skip to content

Commit 03cf2ec

Browse files
AmandaCameronguyzmo
authored andcommitted
Manually grab the service inside set_repo_slug to prevent a loop and the possibility of it being unset.
1 parent ae2a388 commit 03cf2ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git_repo/repo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ def set_repo_slug(self, repo_slug, auto=False):
212212
# in case a full URL is given as parameter, just extract the slug part.
213213
*namespace, self.repo_name = self.repo_slug.split('/')
214214
self.namespace = '/'.join(namespace)
215-
if len(namespace) > self.service._max_nested_namespaces:
215+
216+
# This needs to be manually plucked because otherwise it'll be unset for some commands.
217+
service = RepositoryService.get_service(None, self.target)
218+
if len(namespace) > service._max_nested_namespaces:
216219
raise ArgumentError('Too many slashes.'
217220
'The maximum depth of namespaces is: {}'.format(self.service._max_nested_namespaces))
218221
else:

0 commit comments

Comments
 (0)