public static void Clone(string url, string path) { var command = new NGit.Api.CloneCommand(); command.SetURI(url); command.SetDirectory(new Sharpen.FilePath(path)); var result = command.Call(); }
public void CanClone() { if(Directory.Exists(Path.Combine(ResourcesDir, "Clone"))) Directory.Delete(Path.Combine(ResourcesDir, "Clone"),true); var cmd = new NGit.Api.CloneCommand(); cmd.SetURI(Path.Combine(ResourcesDir, "RemoteRepo")); cmd.SetDirectory(Path.Combine(ResourcesDir, "Clone")); var git = cmd.Call(); Assert.IsNotNull(git.GetRepository()); }
public void CanClone() { if (Directory.Exists(Path.Combine(ResourcesDir, "Clone"))) { Directory.Delete(Path.Combine(ResourcesDir, "Clone"), true); } var cmd = new NGit.Api.CloneCommand(); cmd.SetURI(Path.Combine(ResourcesDir, "RemoteRepo")); cmd.SetDirectory(Path.Combine(ResourcesDir, "Clone")); var git = cmd.Call(); Assert.IsNotNull(git.GetRepository()); }
// Creates directory if not exists public virtual void Clone(string path, string url) { NGit.Api.CloneCommand clone = NGit.Api.Git.CloneRepository().SetDirectory(path).SetURI(url); NGit.Api.Git repository = clone.Call(); CloseRepository(repository); } // End Sub Clone