We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 327881c commit db3c671Copy full SHA for db3c671
docs/source/conf.py
@@ -115,19 +115,23 @@
115
import os
116
import subprocess
117
118
+
119
def get_git_branch():
120
try:
121
# Check if running on ReadTheDocs
122
if os.environ.get("READTHEDOCS") == "True":
123
return os.environ.get("READTHEDOCS_GIT_IDENTIFIER", "master")
-
124
125
# Otherwise, get the current branch from git locally
- return subprocess.check_output(
126
- ["git", "rev-parse", "--abbrev-ref", "HEAD"]
127
- ).decode("utf-8").strip()
+ return (
+ subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
128
+ .decode("utf-8")
129
+ .strip()
130
+ )
131
except Exception:
132
return "master"
133
134
135
current_branch = get_git_branch()
136
137
html_theme_options = {
0 commit comments