Skip to content

Commit e103d29

Browse files
committed
Shallow clone
Close readthedocs#1888
1 parent b15e5d3 commit e103d29

File tree

1 file changed

+3
-2
lines changed
  • readthedocs/vcs_support/backends

1 file changed

+3
-2
lines changed

readthedocs/vcs_support/backends/git.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def validate_submodules(self, config):
131131

132132
def fetch(self):
133133
code, stdout, stderr = self.run(
134-
'git', 'fetch', '--tags', '--prune', '--prune-tags',
134+
'git', 'fetch', '--depth=1', '--tags', '--prune', '--prune-tags',
135135
)
136136
if code != 0:
137137
raise RepositoryError
@@ -150,7 +150,8 @@ def checkout_revision(self, revision=None):
150150
def clone(self):
151151
"""Clones the repository."""
152152
code, stdout, stderr = self.run(
153-
'git', 'clone', self.repo_url, '.'
153+
'git', 'clone', '--depth=1', '--no-single-branch',
154+
self.repo_url, '.'
154155
)
155156
if code != 0:
156157
raise RepositoryError

0 commit comments

Comments
 (0)