Fix GitHub code link generation when failing to resolve tracking branches.

Review Request #12739 — Created Nov. 27, 2022 and submitted — Latest diff uploaded

Information

beanbag-docutils
master

Reviewers

When failing to resolve tracking branches, we'd end up with a None
result, which would then get fed back into a git rev-parse, causing an
error.

This change avoids this situation, and ensures we don't try to generate
a link if we fail to locate a branch (since it won't have a stable SHA
to point to). It also and asserts that we don't pass in either a None
for the command or any falsey values in the list.

Unit tests pass.

Successfully built Review Board docs.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix GitHub code link generation when failing to resolve tracking branches.
When failing to resolve tracking branches, we'd end up with a `None` result, which would then get fed back into a `git rev-parse`, causing an error. This change avoids this situation, and ensures we don't try to generate a link if we fail to locate a branch (since it won't have a stable SHA to point to). It also and asserts that we don't pass in either a `None` for the command or any falsey values in the list.
c9186bb4977410bffe667fb9fc2a5ce7f1961542 Christian Hammond
beanbag_docutils/sphinx/ext/github.py
beanbag_docutils/sphinx/ext/tests/test_github.py
Loading...