From 8d11634108c6508674cde5e0e1b69c346a5a6bfd Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 11 Nov 2019 02:04:37 +0100 Subject: [PATCH] git clone: Force use of ssh protocol if not specified If we don't specify the protocol, then specifying the port number doens't work. --- CHANGELOG.md | 3 +++ lib/apis/git.dart | 5 +++++ pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f6901ce..cb2a19b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.19] - 2019-11-11 +* Bug: Allow cloning from a custom port + ## [1.18] - 2019-11-02 * Better handling of Markdown files without YAML headers diff --git a/lib/apis/git.dart b/lib/apis/git.dart index 3821aa11..ea302405 100644 --- a/lib/apis/git.dart +++ b/lib/apis/git.dart @@ -70,6 +70,11 @@ class GitRepo { static Future clone(String folderName, String cloneUrl) async { try { + if (!cloneUrl.startsWith('ssh://') && + !cloneUrl.startsWith('http://') && + !cloneUrl.startsWith('https://')) { + cloneUrl = 'ssh://' + cloneUrl; + } await invokePlatformMethod('gitClone', { 'cloneUrl': cloneUrl, 'folderName': folderName, diff --git a/pubspec.yaml b/pubspec.yaml index c00753a2..f530cf68 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: gitjournal description: A Journaling App Built on top of Git -version: 1.18+10 +version: 1.19+10 dependencies: flutter: