projects
/
tools
/
git-buildpackage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e30ce3
)
repository: Add helper to prefix branch with 'refs/heads/'
author
Doesnot Matter
<you@example.com>
Thu, 26 May 2022 17:53:49 +0000
(19:53 +0200)
committer
Doesnot Matter
<you@example.com>
Thu, 26 May 2022 17:53:49 +0000
(19:53 +0200)
No attempt is being made to ensure this is a local branch.
gbp/git/repository.py
patch
|
blob
|
history
diff --git
a/gbp/git/repository.py
b/gbp/git/repository.py
index 4d11fae6886fef996c724c2184e97b63a9a68259..edbdfe9f2ddd8a18a6e887313b0db8501c959b62 100644
(file)
--- 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):