From afd12d48fa8dfa883e82cfc9e2573ace80c2d0aa Mon Sep 17 00:00:00 2001 From: Rasmus Bertell Date: Sun, 15 Sep 2024 13:26:34 +0300 Subject: [PATCH] fix: add optional arguments to signatures If the commands are run with extra arguments without them being defined the command fails. This fix allows calling the `pre-push` and `prepare-commit-msg` hooks with all their arguments while still retaining the old behavior since the arguments are optional. Reference: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks closes #31 --- src/Console/Commands/PrePush.php | 2 +- src/Console/Commands/PrepareCommitMessage.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Console/Commands/PrePush.php b/src/Console/Commands/PrePush.php index 353956b..1306033 100644 --- a/src/Console/Commands/PrePush.php +++ b/src/Console/Commands/PrePush.php @@ -15,7 +15,7 @@ class PrePush extends Command implements HookCommand * * @var string */ - protected $signature = 'git-hooks:pre-push'; + protected $signature = 'git-hooks:pre-push {remote?} {url?}'; /** * The console command description. diff --git a/src/Console/Commands/PrepareCommitMessage.php b/src/Console/Commands/PrepareCommitMessage.php index c883cee..9fffe31 100644 --- a/src/Console/Commands/PrepareCommitMessage.php +++ b/src/Console/Commands/PrepareCommitMessage.php @@ -15,7 +15,7 @@ class PrepareCommitMessage extends Command implements HookCommand * * @var string */ - protected $signature = 'git-hooks:prepare-commit-msg {file}'; + protected $signature = 'git-hooks:prepare-commit-msg {file} {type?} {sha?}'; /** * The console command description.