Skip to content

Commit 200f9a8

Browse files
authored
Feature flag: remove DONT_SHALLOW_CLONE (#10588)
* Feature flag: remove `DONT_SHALLOW_CLONE` This can be done now by using `build.jobs.post_checkout`. See an example at https://docs.readthedocs.io/en/latest/build-customization.html#unshallow-git-clone * Use a different `start_time` to make the API call valid * Resolve merge conflict * Solve merge conflict * Move code to simplify diff * Remove double space
1 parent bcac962 commit 200f9a8

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

readthedocs/projects/models.py

-5
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,6 @@ def add_features(sender, **kwargs):
19281928
# may be added by other packages
19291929
MKDOCS_THEME_RTD = "mkdocs_theme_rtd"
19301930
API_LARGE_DATA = "api_large_data"
1931-
DONT_SHALLOW_CLONE = "dont_shallow_clone"
19321931
CONDA_APPEND_CORE_REQUIREMENTS = "conda_append_core_requirements"
19331932
ALL_VERSIONS_IN_HTML_CONTEXT = "all_versions_in_html_context"
19341933
CDN_ENABLED = "cdn_enabled"
@@ -1969,10 +1968,6 @@ def add_features(sender, **kwargs):
19691968
MKDOCS_THEME_RTD,
19701969
_("MkDocs: Use Read the Docs theme for MkDocs as default theme"),
19711970
),
1972-
(
1973-
DONT_SHALLOW_CLONE,
1974-
_("Build: Do not shallow clone when cloning git repos"),
1975-
),
19761971
(
19771972
API_LARGE_DATA,
19781973
_("Build: Try alternative method of posting large data"),

readthedocs/vcs_support/backends/git.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def get_remote_fetch_refspec(self):
148148
)
149149

150150
def clone(self):
151+
"""Clones the repository."""
151152
# TODO: We should add "--no-checkout" in all git clone operations, except:
152153
# There exists a case of version_type=BRANCH without a branch name.
153154
# This case is relevant for building projects for the first time without knowing the name
@@ -268,19 +269,6 @@ def validate_submodules(self, config):
268269
return False, invalid_submodules
269270
return True, submodules.keys()
270271

271-
def use_shallow_clone(self):
272-
"""
273-
Test whether shallow clone should be performed.
274-
275-
.. note::
276-
277-
Temporarily, we support skipping this option as builds that rely on
278-
git history can fail if using shallow clones. This should
279-
eventually be configurable via the web UI.
280-
"""
281-
from readthedocs.projects.models import Feature
282-
return not self.project.has_feature(Feature.DONT_SHALLOW_CLONE)
283-
284272
def checkout_revision(self, revision):
285273
try:
286274
code, out, err = self.run('git', 'checkout', '--force', revision)

0 commit comments

Comments
 (0)