Exemplo n.º 1
0
        public ISyncPoint this[int id]
        {
            get
            {
                if (!GitGroup.Repository.LocalBranchExists(BranchName))
                {
                    throw new SyncPointNotFoundException(id);
                }

                var root = new GitDirectory(null, "root", GitGroup.Repository.GetLocalBranch(BranchName).Tip);
                var relativePath = GetRelativeSynchronizationStateFilePath(id);

                if (!root.FileExists(relativePath))
                {
                    throw new SyncPointNotFoundException(id);
                }

                return SyncPointStateFile.Load(null, (IReadableFile)root.GetFile(relativePath)).Content;
            }
        }
Exemplo n.º 2
0
        public ConflictInfo this[string filePath]
        {
            get
            {
                PathValidator.EnsureIsValidFilePath(filePath);
                PathValidator.EnsureIsRootedPath(filePath);

                if (!GitGroup.Repository.LocalBranchExists(BranchName))
                {
                    throw new ItemNotFoundException($"There is no ConflictInfo for file '{filePath}'");
                }

                var root = new GitDirectory(null, "root", GitGroup.Repository.GetLocalBranch(BranchName).Tip);

                var relativePath = GetRelativeConflictInfoFilePath(filePath);
                if (!root.FileExists(relativePath))
                {
                    throw new ItemNotFoundException($"There is no ConflictInfo for file '{filePath}'");
                }

                var file = (IReadableFile) root.GetFile(relativePath);
                return ConflictInfoFile.Load(null, file).Content;
            }
        }