We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59209ae commit 999a39bCopy full SHA for 999a39b
readthedocs/vcs_support/backends/git.py
@@ -174,9 +174,14 @@ def tags(self):
174
def branches(self):
175
repo = git.Repo(self.working_dir)
176
versions = []
177
+
178
# ``repo.branches`` returns local branches and
179
+ branches = repo.branches
180
# ``repo.remotes.origin.refs`` returns remote branches
- for branch in repo.branches + repo.remotes.origin.refs:
181
+ if repo.remotes:
182
+ branches += repo.remotes.origin.refs
183
184
+ for branch in branches:
185
verbose_name = branch.name
186
if verbose_name.startswith('origin/'):
187
verbose_name = verbose_name.replace('origin/', '')
0 commit comments