public static IEnumerable <string> Checkout(string treeish, IEnumerable <string> paths = null, GitArguments.CheckoutOptions options = default) { if (string.IsNullOrEmpty(treeish)) { throw new ArgumentNullException(nameof(treeish)); } yield return("checkout"); yield return("-q"); if (options.Track) { yield return("--track"); } yield return(treeish); if (paths != null) { yield return("--"); foreach (var path in paths.Select(QuoteEscape)) { yield return(path); } } }
public Task <ExecutionResult> CheckoutAsync(string treeish, IEnumerable <string> paths = null, GitArguments.CheckoutOptions options = default) => RunGitAsync(GitArguments.Checkout(treeish, paths, options));