Skip to content

Commit

Permalink
Handle detached head in legit branches
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Rose committed Apr 9, 2012
1 parent ee3325d commit 684d7b7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions legit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,13 @@ def display_available_branches():

for branch in branches:

marker = '*' if (branch.name == repo.head.ref.name) else ' '
color = colored.green if (branch.name == repo.head.ref.name) else colored.yellow
try:
branch_is_selected = (branch.name == repo.head.ref.name)
except TypeError:
branch_is_selected = False

marker = '*' if branch_is_selected else ' '
color = colored.green if branch_is_selected else colored.yellow
pub = '(published)' if branch.is_published else '(unpublished)'

print columns(
Expand Down Expand Up @@ -520,4 +525,4 @@ def handle_abort(aborted):
hv='harvest',
har='harvest',
h='help'
)
)

0 comments on commit 684d7b7

Please sign in to comment.