private static Executable GetGitExe(string repositoryPath) { if (!Path.IsPathRooted(repositoryPath)) { repositoryPath = Path.Combine(PathHelper.LocalRepositoriesDir, repositoryPath); } FileSystemHelpers.EnsureDirectory(repositoryPath); var exe = new GitExecutable(repositoryPath); exe.SetTraceLevel(2); exe.SetHttpVerbose(true); exe.SetSSLNoVerify(true); return exe; }
public static string CloneToLocal(string cloneUri, string path = null) { string repositoryPath = path ?? Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); Directory.CreateDirectory(repositoryPath); var exe = new GitExecutable(repositoryPath, idleTimeout: TimeSpan.FromSeconds(3600)); exe.SetTraceLevel(2); exe.SetHttpVerbose(true); exe.SetSSLNoVerify(true); GitExecute(exe, "clone \"{0}\" .", cloneUri); return repositoryPath; }
private static Executable GetGitExe(string repositoryPath, IDictionary<string, string> environments = null) { if (!Path.IsPathRooted(repositoryPath)) { repositoryPath = Path.Combine(PathHelper.LocalRepositoriesDir, repositoryPath); } FileSystemHelpers.EnsureDirectory(repositoryPath); // Use a really long idle timeout, since it's mostly meaningful when running on server, not client var exe = new GitExecutable(repositoryPath, idleTimeout: TimeSpan.FromSeconds(3600)); exe.SetTraceLevel(2); exe.SetHttpVerbose(true); exe.SetSSLNoVerify(true); if (environments != null) { foreach (var pair in environments) { exe.EnvironmentVariables.Add(pair); } } return exe; }
private static Executable GetGitExe(string repositoryPath, IDictionary<string, string> environments = null) { if (!Path.IsPathRooted(repositoryPath)) { repositoryPath = Path.Combine(PathHelper.LocalRepositoriesDir, repositoryPath); } FileSystemHelpers.EnsureDirectory(repositoryPath); var exe = new GitExecutable(repositoryPath); exe.SetTraceLevel(2); exe.SetHttpVerbose(true); exe.SetSSLNoVerify(true); if (environments != null) { foreach (var pair in environments) { exe.EnvironmentVariables.Add(pair); } } return exe; }