From 7f7b1274626fd35d6a3122faa01837e413fc2cd6 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 30 Apr 2021 11:31:08 -0700 Subject: [PATCH 1/2] Fixed regression where `testRepository` would erroneously pass with invalid credentials. Fixed Exception thrown with `bin/plugin git-sync status` command, preventing `sync` (#199, fixes #200) --- CHANGELOG.md | 7 +++++++ classes/GitSync.php | 2 +- cli/StatusCommand.php | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f4400d..deee7e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v2.3.1 +## 04/30/2021 + +1. [](#bugfix) + * Fixed regression where `testRepository` would erroneously pass with invalid credentials [#200](https://github.com/trilbymedia/grav-plugin-git-sync/issues/200) + * Fixed Exception thrown with `bin/plugin git-sync status` command, preventing `sync` [#200](https://github.com/trilbymedia/grav-plugin-git-sync/issues/200) + # v2.3.0 ## 04/27/2021 diff --git a/classes/GitSync.php b/classes/GitSync.php index 4b52edd..0c90830 100644 --- a/classes/GitSync.php +++ b/classes/GitSync.php @@ -481,7 +481,7 @@ public function execute($command, $quiet = false) exec($command, $output, $returnValue); } - if ($returnValue !== 0 && (!empty($output) && $returnValue === 5) && !$quiet) { + if ($returnValue !== 0 && $returnValue !== 5 && !$quiet) { throw new \RuntimeException(implode("\r\n", $output)); } diff --git a/cli/StatusCommand.php b/cli/StatusCommand.php index 2999204..a3d5c71 100644 --- a/cli/StatusCommand.php +++ b/cli/StatusCommand.php @@ -90,7 +90,8 @@ protected function serve() Helper::prepareRepository( $plugin->getUser() ?? '', $password, - $repository) + $repository), + $plugin->getRemote('branch', null), ); $this->console_log($testRepository, $password); From d513226bd0f431753fe20c5b975f3cf53c65b776 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 30 Apr 2021 11:32:27 -0700 Subject: [PATCH 2/2] Preparing for release --- blueprints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints.yaml b/blueprints.yaml index c13c1e4..150ef92 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Git Sync type: plugin slug: git-sync -version: 2.3.0 +version: 2.3.1 description: Allows to synchronize portions of Grav with Git Repositories (GitHub, BitBucket, GitLab) icon: git author: