Skip to content

Commit b9aff0c

Browse files
authored
Merge pull request #6109 from pllim/patch-1
Use the force when fetching with Git
2 parents 59738a1 + fcc725c commit b9aff0c

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

readthedocs/vcs_support/backends/git.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ def use_shallow_clone(self):
148148
return not self.project.has_feature(Feature.DONT_SHALLOW_CLONE)
149149

150150
def fetch(self):
151+
# --force lets us checkout branches that are not fast-forwarded
152+
# https://github.com/readthedocs/readthedocs.org/issues/6097
151153
cmd = ['git', 'fetch', 'origin',
152-
'--tags', '--prune', '--prune-tags']
154+
'--force', '--tags', '--prune', '--prune-tags']
153155

154156
if self.use_shallow_clone():
155157
cmd.extend(['--depth', str(self.repo_depth)])

0 commit comments

Comments
 (0)