mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
26
src/Commands/Clone.cs
Normal file
26
src/Commands/Clone.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
|
||||
/// <summary>
|
||||
/// 克隆
|
||||
/// </summary>
|
||||
public class Clone : Command {
|
||||
private Action<string> handler = null;
|
||||
|
||||
public Clone(string path, string url, string localName, string extraArgs, Action<string> outputHandler) {
|
||||
Cwd = path;
|
||||
TraitErrorAsOutput = true;
|
||||
Args = "-c credential.helper=manager clone --progress --verbose --recurse-submodules ";
|
||||
handler = outputHandler;
|
||||
|
||||
if (!string.IsNullOrEmpty(extraArgs)) Args += $"{extraArgs} ";
|
||||
Args += $"{url} ";
|
||||
if (!string.IsNullOrEmpty(localName)) Args += localName;
|
||||
}
|
||||
|
||||
public override void OnReadline(string line) {
|
||||
handler?.Invoke(line);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue