Skip to content
Snippets Groups Projects
Commit 36fe09f5f276 authored by Georges Racinet's avatar Georges Racinet :squid:
Browse files

gitlab.branch: new branch_is_topic() helper

parent 879b27dcdfb5
1 merge request!107Edge cases with a topic as default Heptapod branch
......@@ -83,6 +83,19 @@
return ref.startswith(WILD_BRANCH_REF_PREFIX)
def branch_is_topic(branch):
"""Tell if GitLab branch is a topic.
Examples::
>>> branch_is_topic(b'branch/gnu')
False
>>> branch_is_topic(b'topic/default/gnu')
True
"""
return branch.startswith(TOPIC_BRANCH_PREFIX)
def parse_ref(ref):
"""Parse a Git branch ref for named branch and topic information
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment