示例#1
0
        public FileSystem(List <Path> paths, CallDirectory callDirectory)
        {
            _callDirectory = callDirectory;
            FileSystemParser parser = new FileSystemParser(paths);

            _rootDirectory = parser.GetContent();
        }
示例#2
0
        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();
        }
示例#3
0
        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");
            }
        }
示例#4
0
        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));
        }
示例#5
0
 public StatusCommand(CallDirectory callDirectory)
 {
     _callDirectory = callDirectory;
 }
示例#6
0
 public AddCommand(Command command)
 {
     _command       = command;
     _callDirectory = command.CallDirectory;
 }
示例#7
0
 public CommitCommand(Command command)
 {
     _callDirectory = command.CallDirectory;
     _command       = command;
 }