Skip to content

Commit

Permalink
Do not commit / push if not necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
JmeHsieh committed Sep 22, 2016
1 parent ec1dce7 commit 060c9ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hackfoldrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def copy_to_repo(self):
def commit_push(self):
if not self.repo:
raise 'NoRepoError'
elif len(self.repo.index.diff(None)) == 0:
logging.info('nothing to commit')
return

logging.info('git add .')
self.repo.index.add('*')
Expand Down

0 comments on commit 060c9ab

Please sign in to comment.