diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-05-11 17:08:32 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-05-11 17:08:32 -0400 |
commit | 585f17c82f472991568d058dc24ec44668968a32 (patch) | |
tree | 279ff71da30699bd50363af78e92f52dd03ae947 | |
parent | 9597ccf8f856ec1d3a80486d0b1591d5a8ab8a67 (diff) | |
download | b4-585f17c82f472991568d058dc24ec44668968a32.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.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |