mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Merge pull request #1013 from ZyX-I/fix-341
Catch errors from tree_status
This commit is contained in:
commit
e7ef2d14d3
@ -196,7 +196,7 @@ class TreeStatusCache(dict):
|
|||||||
if self.tw(key, ignore_event=getattr(repo, 'ignore_event', None)):
|
if self.tw(key, ignore_event=getattr(repo, 'ignore_event', None)):
|
||||||
self.pop(key, None)
|
self.pop(key, None)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
self.pl.warn('Failed to check %s for changes, with error: %s' % key, e)
|
self.pl.warn('Failed to check {0} for changes, with error: {1}', key, str(e))
|
||||||
return self.cache_and_get(key, repo.status)
|
return self.cache_and_get(key, repo.status)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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:
|
||||||
status = tree_status(repo, pl)
|
try:
|
||||||
|
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