From 0c1245eaefa3729a67acf119f881aea9da1b8380 Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Sun, 26 May 2024 12:24:19 +0200 Subject: [PATCH] Pre-push has its own context --- src/Console/Command/Git/PrePushCommand.php | 4 ++-- src/Task/Context/GitPrePushContext.php | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/Task/Context/GitPrePushContext.php diff --git a/src/Console/Command/Git/PrePushCommand.php b/src/Console/Command/Git/PrePushCommand.php index 43e66402b..62cdce7e5 100644 --- a/src/Console/Command/Git/PrePushCommand.php +++ b/src/Console/Command/Git/PrePushCommand.php @@ -9,7 +9,7 @@ use GrumPHP\Git\GitRepository; use GrumPHP\Runner\TaskRunner; use GrumPHP\Runner\TaskRunnerContext; -use GrumPHP\Task\Context\GitPreCommitContext; +use GrumPHP\Task\Context\GitPrePushContext; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -55,7 +55,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $context = ( new TaskRunnerContext( - new GitPreCommitContext($files), + new GitPrePushContext($files), $this->testSuites->getOptional('git_pre_push') ) )->withSkippedSuccessOutput((bool) $input->getOption('skip-success-output')); diff --git a/src/Task/Context/GitPrePushContext.php b/src/Task/Context/GitPrePushContext.php new file mode 100644 index 000000000..8bd63ef54 --- /dev/null +++ b/src/Task/Context/GitPrePushContext.php @@ -0,0 +1,22 @@ +files = $files; + } + + public function getFiles(): FilesCollection + { + return $this->files; + } +}