public static Task<IRepository> CloneAsync(Uri url, Uri destination, bool deleteOnDispose)
{
var proc = new Process
{
StartInfo = new ProcessStartInfo("git", $"clone --depth 1 {url.ToString()} {destination.AbsolutePath}"),
EnableRaisingEvents = true
};
var tcs = new TaskCompletionSource<IRepository>();
proc.Exited += (sender, ev) => {
// We use AbsolutePath because we know this is a file.
var repository = new GitRepository(destination, url.ToString(), deleteOnDispose);