Skip to content

Commit 785563f

Browse files
committed
Support local git branches in tests
1 parent e2282b8 commit 785563f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

readthedocs/settings/test.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class CommunityTestSettings(CommunityDevSettings):
1616

1717
DEBUG = False
1818
TEMPLATE_DEBUG = False
19+
LOCAL_GIT_BRANCHES = True
1920

2021
@property
2122
def LOGGING(self): # noqa - avoid pep8 N802

readthedocs/vcs_support/backends/git.py

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import git
1616
from builtins import str
1717
from django.core.exceptions import ValidationError
18+
from django.conf import settings
1819
from git.exc import BadName
1920

2021
from readthedocs.config import ALL
@@ -182,6 +183,8 @@ def branches(self):
182183
# ``repo.remotes.origin.refs`` returns remote branches
183184
if repo.remotes:
184185
branches += repo.remotes.origin.refs
186+
if getattr(settings, 'LOCAL_GIT_BRANCHES', False):
187+
branches += repo.branches
185188

186189
for branch in branches:
187190
verbose_name = branch.name

0 commit comments

Comments
 (0)