fix(Repository.csClone.xaml.cs): 修复之前的更改(232165fa3eafdd0d5589963f0a26a487e7075bcf)导致Remote name 不能正常设置

This commit is contained in:
ZCShou 2020-07-24 21:11:40 +08:00
parent ceff6ef102
commit 6125c17354
2 changed files with 9 additions and 6 deletions

View file

@ -430,7 +430,14 @@ namespace SourceGit.Git {
/// <param name="onProgress"></param> /// <param name="onProgress"></param>
/// <returns></returns> /// <returns></returns>
public static Repository Clone(string url, string folder, string rName, string lName, Action<string> onProgress) { public static Repository Clone(string url, string folder, string rName, string lName, Action<string> 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); if (line != null) onProgress?.Invoke(line);
}, true); }, true);

View file

@ -87,11 +87,7 @@ namespace SourceGit.UI {
string rName; string rName;
if (string.IsNullOrWhiteSpace(RemoteName)) if (string.IsNullOrWhiteSpace(RemoteName))
{ {
var from = RemoteUri.LastIndexOfAny(new char[] { '\\', '/' }); rName = null;
if (from <= 0) return;
var name = RemoteUri.Substring(from + 1);
rName = name.Replace(".git", "");
} }
else else
{ {