From b0965604695c1e28e9b3632e27ec6131d8aad13e Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Wed, 22 Mar 2017 14:00:03 +0100 Subject: [PATCH] #618: Refine `git_push_without_commits` rule --- thefuck/rules/git_push_without_commits.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/thefuck/rules/git_push_without_commits.py b/thefuck/rules/git_push_without_commits.py index b9c4ae2..a132131 100644 --- a/thefuck/rules/git_push_without_commits.py +++ b/thefuck/rules/git_push_without_commits.py @@ -1,14 +1,13 @@ import re +from thefuck.specific.git import git_support -fix = 'git commit -m "Initial commit." && {command}' +fix = u'git commit -m "Initial commit." && {command}' refspec_does_not_match = re.compile(r'src refspec \w+ does not match any\.') +@git_support def match(command): - if refspec_does_not_match.search(command.stderr): - return True - - return False + return bool(refspec_does_not_match.search(command.stderr)) def get_new_command(command):