From 6125c17354d62fcab1efdd182d50c999e78debb6 Mon Sep 17 00:00:00 2001
From: ZCShou <72115@163.com>
Date: Fri, 24 Jul 2020 21:11:40 +0800
Subject: [PATCH] =?UTF-8?q?fix(Repository.csClone.xaml.cs):=20=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E4=B9=8B=E5=89=8D=E7=9A=84=E6=9B=B4=E6=94=B9=EF=BC=88?=
=?UTF-8?q?232165fa3eafdd0d5589963f0a26a487e7075bcf=EF=BC=89=E5=AF=BC?=
=?UTF-8?q?=E8=87=B4Remote=20name=20=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SourceGit/Git/Repository.cs | 9 ++++++++-
SourceGit/UI/Clone.xaml.cs | 6 +-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/SourceGit/Git/Repository.cs b/SourceGit/Git/Repository.cs
index b52f0b40..cef88973 100644
--- a/SourceGit/Git/Repository.cs
+++ b/SourceGit/Git/Repository.cs
@@ -430,7 +430,14 @@ namespace SourceGit.Git {
///
///
public static Repository Clone(string url, string folder, string rName, string lName, Action onProgress) {
- var errs = RunCommand(folder, $"-c credential.helper=manager clone --progress --verbose --origin {rName} --recurse-submodules {url} {lName}", line => {
+ string RemoteName;
+ if (rName != null) {
+ RemoteName = $" --origin {rName}";
+ } else {
+ RemoteName = null;
+ }
+
+ var errs = RunCommand(folder, $"-c credential.helper=manager clone --progress --verbose {RemoteName} --recurse-submodules {url} {lName}", line => {
if (line != null) onProgress?.Invoke(line);
}, true);
diff --git a/SourceGit/UI/Clone.xaml.cs b/SourceGit/UI/Clone.xaml.cs
index ef82134b..957f828b 100644
--- a/SourceGit/UI/Clone.xaml.cs
+++ b/SourceGit/UI/Clone.xaml.cs
@@ -87,11 +87,7 @@ namespace SourceGit.UI {
string rName;
if (string.IsNullOrWhiteSpace(RemoteName))
{
- var from = RemoteUri.LastIndexOfAny(new char[] { '\\', '/' });
- if (from <= 0) return;
-
- var name = RemoteUri.Substring(from + 1);
- rName = name.Replace(".git", "");
+ rName = null;
}
else
{