Skip to content

Commit

Permalink
Fix git bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalHonegger committed Jul 4, 2017
1 parent f546b2e commit fd0ed0f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ def check_untracked_files(self):

print(split_diff)

if len(split_diff) != 3:
if len(split_diff) == 1:
return

changed_files = split_diff[0].replace(" files changed", "")
insertions = split_diff[1].replace(" insertions(+)", "")
deletions = split_diff[2].replace(" deletions(-)", "")
changed_files = split_diff[0].replace(" files changed", "").replace(" file changed", "")
if len(split_diff) == 3:
insertions = split_diff[1].replace(" insertions(+)", "")
deletions = split_diff[2].replace(" deletions(-)", "")
else:
if "insertion" in split_diff[1]:
insertions = split_diff[1].replace(" insertions(+)", "")
deletions = 0
else:
insertions = 0
deletions = split_diff[1].replace(" deletions(-)", "")

if changed_files and int(changed_files) > self.config.requirements.changed_files:
has_exceeded_limit = True
Expand Down

0 comments on commit fd0ed0f

Please sign in to comment.