Пример #1
0
        public List <GitCommitRef> GetAllCommits()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()).Result);
        }
Пример #2
0
        public List <GitCommitRef> GetCommitsByCommitter()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                Committer = "*****@*****.**"
            }).Result);
        }
Пример #3
0
        public List <GitCommitRef> GetCommitsReachableFromACommit()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                // Earliest commit in the graph to search.
                CompareVersion = m_oldestDescriptor
            }).Result);
        }
Пример #4
0
        public List <GitCommitRef> GetCommitsInDateRange()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                FromDate = new DateTime(2018, 6, 14).ToString(),
                ToDate = new DateTime(2018, 6, 16).ToString()
            }).Result);
        }
Пример #5
0
        public List <GitCommitRef> GetCommitsReachableFromACommitAndInPath()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                CompareVersion = m_tipCommitDescriptor,
                ItemVersion = m_oldestDescriptor,
                ItemPath = "/README.md",
            }).Result);
        }
Пример #6
0
        public List <GitCommitRef> GetCommitsOnABranch()
        {
            GitRepository repo = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                ItemVersion = new GitVersionDescriptor()
                {
                    VersionType = GitVersionType.Branch,
                    VersionOptions = GitVersionOptions.None,
                    Version = "master"
                }
            }).Result);
        }
Пример #7
0
        public List <GitCommitRef> GetCommitsOnABranch()
        {
            GitRepository repo       = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);
            string        branchName = repo.DefaultBranch;
            string        branchNameWithoutRefsHeads = branchName.Remove(0, "refs/heads/".Length);

            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                ItemVersion = new GitVersionDescriptor()
                {
                    VersionType = GitVersionType.Branch,
                    VersionOptions = GitVersionOptions.None,
                    Version = branchNameWithoutRefsHeads
                }
            }).Result);
        }
Пример #8
0
        public List <GitCommitRef> GetCommitsReachableFromACommitAndInPath()
        {
            GitRepository        repo       = GitSampleHelpers.FindAnyRepositoryOnAnyProject(this.Context);
            string               branchName = repo.DefaultBranch;
            string               branchNameWithoutRefsHeads = branchName.Remove(0, "refs/heads/".Length);
            GitVersionDescriptor tipCommitDescriptor        = new GitVersionDescriptor()
            {
                VersionType    = GitVersionType.Branch,
                VersionOptions = GitVersionOptions.None,
                Version        = branchNameWithoutRefsHeads
            };


            return(this.Context.Connection.GetClient <GitHttpClient>()
                   .GetCommitsAsync(repo.Id, new GitQueryCommitsCriteria()
            {
                CompareVersion = tipCommitDescriptor,
                ItemVersion = m_oldestDescriptor,
                ItemPath = "/README.md",
            }).Result);
        }