Skip to content

Commit

Permalink
Fix detection of staged files
Browse files Browse the repository at this point in the history
  • Loading branch information
kemayo committed Sep 29, 2011
1 parent a39f37d commit 56b5807
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions git.py
Expand Up @@ -229,8 +229,13 @@ def run(self, edit):
self.run_command(['git', 'status', '--untracked-files=no', '--porcelain'], self.porcelain_status_done)
def porcelain_status_done(self, result):
# todo: split out these status-parsing things...
has_files = len([l for l in result.strip().split('\n') if not l[1].isspace()])
if not has_files:
has_staged_files = False
result_lines = result.rstrip().split('\n')
for line in result_lines:
if not line[0].isspace():
has_staged_files = True
break
if not has_staged_files:
self.panel("Nothing to commit")
return
# Okay, get the template!
Expand Down

0 comments on commit 56b5807

Please sign in to comment.