mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
fix(Repository.csClone.xaml.cs): 修复之前的更改(232165fa3eafdd0d5589963f0a26a487e7075bcf)导致Remote name 不能正常设置
This commit is contained in:
parent
ceff6ef102
commit
6125c17354
2 changed files with 9 additions and 6 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue