1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-28 13:38:38 +00:00
thefuck/thefuck/rules/git_commit_add.py
Pablo Santiago Blum de Aguiar 11b70526f7 #1131: Improve git_commit_add rule
Add more capabilities to the rule, remove its priority and fix tests
2021-07-08 21:43:35 +02:00

18 lines
412 B
Python

from thefuck.utils import eager, replace_argument
from thefuck.specific.git import git_support
@git_support
def match(command):
return (
"commit" in command.script_parts
and "no changes added to commit" in command.output
)
@eager
@git_support
def get_new_command(command):
for opt in ("-a", "-p"):
yield replace_argument(command.script, "commit", "commit {}".format(opt))