X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/8351555474ced37a21799755762ad69b3c826d70..fe847176ac839e64d426e6bf8ab7ad67ba3129d6:/stgit/git.py diff --git a/stgit/git.py b/stgit/git.py index d75b54e..8523455 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -272,9 +272,11 @@ def rev_parse(git_id): def branch_exists(branch): """Existence check for the named branch """ - for line in _output_lines(['git-rev-parse', '--symbolic', '--all']): + for line in _output_lines('git-rev-parse --symbolic --all 2>&1'): if line.strip() == branch: return True + if re.compile('[ |/]'+branch+' ').search(line): + raise GitException, 'Bogus branch: %s' % line return False def create_branch(new_branch, tree_id = None):