Skip to content

Commit 863b4af

Browse files
committed
Also protect git clone
1 parent 239b07c commit 863b4af

File tree

1 file changed

+14
-1
lines changed
  • readthedocs/vcs_support/backends

1 file changed

+14
-1
lines changed

readthedocs/vcs_support/backends/git.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,20 @@ def checkout_revision(self, revision=None):
8585
return [code, out, err]
8686

8787
def clone(self):
88-
code, _, _ = self.run('git', 'clone', '--recursive', self.repo_url, '.')
88+
"""Clone the repository
89+
90+
.. note::
91+
Temporarily, we support skipping submodule recursive clone via a
92+
feature flag. This will eventually be configureable with our YAML
93+
config.
94+
"""
95+
# TODO remove with https://github.com/rtfd/readthedocs-build/issues/30
96+
from readthedocs.projects.models import Feature
97+
cmd = ['git', 'clone']
98+
if not self.project.has_feature(Feature.SKIP_SUBMODULES):
99+
cmd.append('--recursive')
100+
cmd.extend([self.repo_url, '.'])
101+
code, _, _ = self.run(*cmd)
89102
if code != 0:
90103
raise RepositoryError
91104

0 commit comments

Comments
 (0)