mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
克隆远程仓库时可选指定远程名,而不是用默认的 origin
This commit is contained in:
parent
b5002cb89d
commit
232165fa3e
3 changed files with 35 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue