From 36353e7f7bdb5dbf0875fb4fc1a5446b834d3ae9 Mon Sep 17 00:00:00 2001 From: bricebou Date: Fri, 29 Apr 2022 11:17:33 +0200 Subject: [PATCH] =?UTF-8?q?On=20n'a=20pas=20besoin=20de=20cr=C3=A9er=20un?= =?UTF-8?q?=20d=C3=A9p=C3=B4t=20vide=20puisque=20l'on=20peut=20passer=20un?= =?UTF-8?q?e=20URL=20(qui=20doit=20se=20finir=20en=20.git=20a=20priori)=20?= =?UTF-8?q?directement=20=C3=A0=20la=20commande=20git=20ls-remote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Command/CoreListerVersions.php | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Command/CoreListerVersions.php b/src/Command/CoreListerVersions.php index e0b820a..d3954bf 100644 --- a/src/Command/CoreListerVersions.php +++ b/src/Command/CoreListerVersions.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class CoreListerVersions extends Command { - private $spip_git_repo = 'https://git.spip.net/spip/spip.git'; + public const _SPIP_GIT_REPO = 'https://git.spip.net/spip/spip.git'; private $versions = []; private $last_xy = ''; private $prev_xy = ''; @@ -47,10 +47,6 @@ class CoreListerVersions extends Command { return Command::FAILURE; } else { - if (!is_dir('.git')) { - $this->gitInit(); - } - $this->versions = $this->listerVersions($type); foreach ($this->versions as $key => $value) { $output->writeln($value); @@ -73,22 +69,6 @@ class CoreListerVersions extends Command { return Command::SUCCESS; } - /** - * gitInit - * - * Initialisation d'un dépôt GIT vierge auquel on déclare le dépôt distant - * du core de spip afin de pouvoir ensuite appeler `git ls-remote origin` - * pour obtenir toutes les branches et tags - * - * @return void - */ - public function gitInit() { - ob_start(); - passthru('git init'); - passthru('git remote add origin ' . $this->spip_git_repo); - ob_end_clean(); - } - /** * listerVersions * @@ -99,7 +79,7 @@ class CoreListerVersions extends Command { $liste = []; if ($type == 'tags') { ob_start(); - passthru('git ls-remote --tags origin'); + passthru('git ls-remote --tags ' . self::_SPIP_GIT_REPO); $tags = ob_get_contents(); ob_end_clean();