refactor<*>: rewrite all codes...

This commit is contained in:
leo 2021-04-29 20:05:55 +08:00
parent 89ff8aa744
commit 30ab8ae954
342 changed files with 17208 additions and 19633 deletions

26
src/Commands/Clone.cs Normal file
View 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);
}
}
}