mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 15:54:30 +02:00
parent
10665f4c7d
commit
2d4897d5dd
@ -69,7 +69,11 @@ def branch(pl, segment_info, create_watcher, status_colors=False):
|
|||||||
branch = repo.branch()
|
branch = repo.branch()
|
||||||
scol = ['branch']
|
scol = ['branch']
|
||||||
if status_colors:
|
if status_colors:
|
||||||
|
try:
|
||||||
status = tree_status(repo, pl)
|
status = tree_status(repo, pl)
|
||||||
|
except Exception as e:
|
||||||
|
pl.exception('Failed to compute tree status: {0}', str(e))
|
||||||
|
status = '?'
|
||||||
scol.insert(0, 'branch_dirty' if status and status.strip() else 'branch_clean')
|
scol.insert(0, 'branch_dirty' if status and status.strip() else 'branch_clean')
|
||||||
return [{
|
return [{
|
||||||
'contents': branch,
|
'contents': branch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user