Skip to content

Commit

Permalink
Filter out empty lines from branch list
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansuarez committed Sep 5, 2023
1 parent 3926d9d commit 64e0b25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions relman.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ def tag(cls, tag):
def get_branches(cls):
for branch in run('git', 'branch').split('\n'):
branch = branch.strip()
if not branch.startswith('*'):
if len(branch) != 0 and not branch.startswith('*'):
yield branch

@classmethod
def get_remote_branches(cls, remote='origin'):
for branch in run('git', 'branch', '--remotes').split('\n'):
branch = branch.strip()
if not branch.startswith(remote + '/HEAD -> '):
if len(branch) != 0 and not branch.startswith(remote + '/HEAD -> '):
yield branch

@classmethod
Expand Down

0 comments on commit 64e0b25

Please sign in to comment.