summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-11 17:08:32 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-11 17:12:07 -0400
commit558b71e226c8d29c4797f799e16eea66ded0532d (patch)
tree1c6619e354213db2333e1d79504c9e5e71c9667b
parent89321511fec7c5e8379cad30025c70f31bea9482 (diff)
downloadb4-558b71e226c8d29c4797f799e16eea66ded0532d.tar.gz
Make sure to always use the full refname
Git will try to helpfully disambiguate, but we just need consistency, so always ask for a full refname. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ty.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/b4/ty.py b/b4/ty.py
index 02898b0..4271986 100644
--- a/b4/ty.py
+++ b/b4/ty.py
@@ -567,12 +567,12 @@ def get_wanted_branch(cmdargs):
logger.debug('will check branch=%s', wantbranch)
else:
# Make sure it's a real branch
- gitargs = ['branch', '--format=%(refname:short)', '--list', '--all']
+ gitargs = ['branch', '--format=%(refname)', '--list', '--all']
lines = b4.git_get_command_lines(gitdir, gitargs)
if not len(lines):
logger.critical('Not able to get a list of branches (git branch --list --all)')
sys.exit(1)
- if cmdargs.branch not in lines:
+ if f'refs/heads/{cmdargs.branch}' not in lines:
logger.critical('Requested branch %s not found in git branch --list --all', cmdargs.branch)
sys.exit(1)
wantbranch = cmdargs.branch