public FileSystem(List <Path> paths, CallDirectory callDirectory) { _callDirectory = callDirectory; FileSystemParser parser = new FileSystemParser(paths); _rootDirectory = parser.GetContent(); }
public FileSystem(List <Blob> blobs, CallDirectory callDirectory) { List <Path> paths = new List <Path>(); foreach (Blob blob in blobs) { paths.Add(blob.FilePath.GetShortPath(callDirectory)); } FileSystemParser parser = new FileSystemParser(paths); _rootDirectory = parser.GetContent(); }
public void Execute() { CallDirectory callDirectory = _command.CallDirectory; if (!callDirectory.IsUnderVersionControl()) { Path directoryPath = callDirectory.GetPath(); string path = directoryPath.ToString() + "\\.repo"; InitializeRepository(path); Console.WriteLine($"The repository is successfully created in {directoryPath.ToString()}"); } else { Console.WriteLine("This directory is already under vcs control"); } }
public Tree ConvertIntoTree(CallDirectory callDirectory, Path currentPath) { List <Tree> subtrees = new List <Tree>(); List <Blob> blobs = new List <Blob>(); foreach (Directory subdirectory in Subdirectories) { Path nextPath = currentPath.ConcatPath(subdirectory.DirectoryName); subtrees.Add(subdirectory.ConvertIntoTree(callDirectory, nextPath)); } foreach (File file in Files) { Path filePath = currentPath.ConcatPath(file.FileName); Blob blob = new Blob(filePath); blobs.Add(blob); } return(new Tree(blobs, subtrees, DirectoryName)); }
public StatusCommand(CallDirectory callDirectory) { _callDirectory = callDirectory; }
public AddCommand(Command command) { _command = command; _callDirectory = command.CallDirectory; }
public CommitCommand(Command command) { _callDirectory = command.CallDirectory; _command = command; }