예제 #1
0
        public GitTag(string name, GitId commit)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Value must not be null or whitespace", nameof(name));
            }

            Name   = name;
            Commit = commit;
        }
예제 #2
0
        public GitDirectoryInfo(GitId commit, string name, GitDirectoryInfo parent, Tree tree)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Value must not be null or whitespace", nameof(name));
            }

            if (name.Contains("\\") || name.Contains("/"))
            {
                throw new ArgumentException("Name must not contain directory separators", nameof(name));
            }

            Commit   = commit;
            Name     = name;
            m_Parent = parent ?? throw new ArgumentNullException(nameof(parent));
            m_Tree   = tree ?? throw new ArgumentNullException(nameof(tree));

            m_Directories = new Lazy <Dictionary <string, GitDirectoryInfo> >(LoadDirectories);
            m_Files       = new Lazy <Dictionary <string, GitFileInfo> >(LoadFiles);
        }
예제 #3
0
 public GitDirectoryInfo GetRootDirectory(GitId commitId) => LocalRepository.GetRootDirectory(commitId);