示例#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);
        }