#1131: Improve git_commit_add rule
Add more capabilities to the rule, remove its priority and fix tests
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
from thefuck.utils import replace_argument
|
||||
from thefuck.utils import eager, replace_argument
|
||||
from thefuck.specific.git import git_support
|
||||
|
||||
priority = 900 # Lower first, default is 1000
|
||||
|
||||
|
||||
@git_support
|
||||
def match(command):
|
||||
return ('commit' in command.script_parts
|
||||
and 'no changes added to commit' in command.output)
|
||||
return (
|
||||
"commit" in command.script_parts
|
||||
and "no changes added to commit" in command.output
|
||||
)
|
||||
|
||||
|
||||
@eager
|
||||
@git_support
|
||||
def get_new_command(command):
|
||||
return replace_argument(command.script, 'commit', 'commit -a')
|
||||
for opt in ("-a", "-p"):
|
||||
yield replace_argument(command.script, "commit", "commit {}".format(opt))
|
||||
|
||||
Reference in New Issue
Block a user