Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sphinx_multiversion/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ def get_toplevel_path(cwd=None):
"git",
"rev-parse",
"--show-toplevel",
"--show-superproject-working-tree",
)
output = subprocess.check_output(cmd, cwd=cwd).decode()
return output.rstrip("\n")
# If this is a git submodule of a super project then we'll have two lines
# of output, otherwise one. Since the superproject flag is second in the
# command above the superproject will always be the last line if present.
return output.split()[-1]


def get_all_refs(gitroot):
Expand Down