|
|
@ -79,7 +79,7 @@ public sealed class GitRepository : IGitRepository
|
|
|
|
await RunGitCmd("remote", "set-url", name, newUrl.ToString());
|
|
|
|
await RunGitCmd("remote", "set-url", name, newUrl.ToString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task Clone(Uri cloneUrl, string? branch = null)
|
|
|
|
public async Task Clone(Uri cloneUrl, string? branch = null, int depth = 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var args = new List<string> {"clone"};
|
|
|
|
var args = new List<string> {"clone"};
|
|
|
|
if (branch is not null)
|
|
|
|
if (branch is not null)
|
|
|
@ -87,6 +87,11 @@ public sealed class GitRepository : IGitRepository
|
|
|
|
args.AddRange(new[] {"-b", branch});
|
|
|
|
args.AddRange(new[] {"-b", branch});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (depth != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
args.AddRange(new[] {"--depth", depth.ToString()});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args.AddRange(new[] {cloneUrl.ToString(), "."});
|
|
|
|
args.AddRange(new[] {cloneUrl.ToString(), "."});
|
|
|
|
await RunGitCmd(args);
|
|
|
|
await RunGitCmd(args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|