using System;
namespace SourceGit.Commands {
///
/// 克隆
///
public class Clone : Command {
private Action handler = null;
public Clone(string path, string url, string localName, string extraArgs, Action 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);
}
}
}