Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
py-heptapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
py-heptapod
Commits
36fe09f5f276
Commit
36fe09f5f276
authored
5 months ago
by
Georges Racinet
Browse files
Options
Downloads
Patches
Plain Diff
gitlab.branch: new branch_is_topic() helper
parent
879b27dcdfb5
Loading
Loading
1 merge request
!107
Edge cases with a topic as default Heptapod branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
heptapod/gitlab/branch.py
+13
-0
13 additions, 0 deletions
heptapod/gitlab/branch.py
with
13 additions
and
0 deletions
heptapod/gitlab/branch.py
+
13
−
0
View file @
36fe09f5
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment