克隆远程仓库时可选指定远程名,而不是用默认的 origin

This commit is contained in:
ZCShou 2020-07-17 10:00:37 +08:00
parent b5002cb89d
commit 232165fa3e
3 changed files with 35 additions and 7 deletions

View file

@ -391,8 +391,8 @@ namespace SourceGit.Git {
/// <param name="name">Local name</param>
/// <param name="onProgress"></param>
/// <returns></returns>
public static Repository Clone(string url, string folder, string name, Action<string> onProgress) {
var errs = RunCommand(folder, $"-c credential.helper=manager clone --progress --verbose --recurse-submodules {url} {name}", line => {
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 => {
if (line != null) onProgress?.Invoke(line);
}, true);
@ -401,7 +401,7 @@ namespace SourceGit.Git {
return null;
}
var path = new DirectoryInfo(folder + "/" + name).FullName;
var path = new DirectoryInfo(folder + "/" + lName).FullName;
var repo = Preference.Instance.AddRepository(path, "");
return repo;
}