protected function execute(InputInterface $input, OutputInterface $output) { // Add the file to the staging index. $git = new GitRepository($input->getArgument('docroot')); if (!is_null($input->getOption('all'))) { $git->add()->all()->execute(); } else { if (!is_null($input->getArgument('file'))) { $git->add()->execute($input->getArgument('file')); } } }
/** * @covers \Bit3\GitPhp\GitRepository::add * @covers \Bit3\GitPhp\Command\AddCommandBuilder::execute */ public function testAddOnUninitializedRepository() { $this->setExpectedException('Bit3\\GitPhp\\GitException'); $this->uninitializedGitRepository->add()->execute('unknown-file.txt'); }