aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 4d11fae6..edbdfe9f 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -653,6 +653,16 @@ class GitRepository(object):
return out[0].decode().strip()
+ @staticmethod
+ def ensure_refs_heads(branch):
+ """
+ Make sure a branch name is prefixed with `refs/heads'
+ """
+ if (branch.startswith('refs/heads/')):
+ return branch
+ #return f'refs/heads/{branch}'
+ return f'{branch}'
+
#{ Tags
def create_tag(self, name, msg=None, commit=None, sign=False, keyid=None):