From 0f1bc647a41ee31db60e536bb6ad263e78f6b439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Fri, 24 Apr 2020 16:35:02 +0200 Subject: [PATCH] Fix git protocol uri for windows Fixes the 'scm' protocol uri for Windows. Have to replace all backslashes with forward slashes, add one more slash at the beginning and remove the colon from the dirve. --- CHANGELOG.md | 3 +++ .../scm/repository/spi/SimpleGitWorkdirFactory.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4beb9f22a3..3f31b52cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Removed the `requires` attribute on the `@Extension` annotation and instead create a new `@Requires` annotation ([#1097](https://github.com/scm-manager/scm-manager/pull/1097)) +### Fixed +- Protocol URI for git commands under windows ([#1108](https://github.com/scm-manager/scm-manager/pull/1108)) + ## [2.0.0-rc7] - 2020-04-09 ### Added - Fire various plugin events ([#1088](https://github.com/scm-manager/scm-manager/pull/1088)) diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/SimpleGitWorkdirFactory.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/SimpleGitWorkdirFactory.java index c13e6b5e19..ff0101f297 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/SimpleGitWorkdirFactory.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/SimpleGitWorkdirFactory.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.repository.spi; import org.eclipse.jgit.api.Git; @@ -34,6 +34,7 @@ import sonia.scm.repository.GitWorkdirFactory; import sonia.scm.repository.InternalRepositoryException; import sonia.scm.repository.util.SimpleWorkdirFactory; import sonia.scm.repository.util.WorkdirProvider; +import sonia.scm.util.SystemUtil; import javax.inject.Inject; import java.io.File; @@ -72,7 +73,11 @@ public class SimpleGitWorkdirFactory extends SimpleWorkdirFactory