Exemplo n.º 1
0
        static async Task <GitCommit> CreateGitCommit(string token, string username, string repository, string shaLatestCommit, GitTree gitTree,
                                                      HttpClient client)
        {
            var gitCommit = new GitCommit
            {
                message = "Update from Markpad",
                parents = new[] { shaLatestCommit },
                tree    = gitTree.sha
            };
            var url     = string.Format("/repos/{0}/{1}/git/commits", username, repository);
            var respose = await client.PostAsJsonAsync(GetUrl(url, token), gitCommit);

            var content = await respose.Content.ReadAsAsync <dynamic>();

            gitCommit.sha = content.sha;
            return(gitCommit);
        }
Exemplo n.º 2
0
        static async Task<GitCommit> CreateGitCommit(string token, string username, string repository, string shaLatestCommit, GitTree gitTree,
                                         HttpClient client)
        {
            var gitCommit = new GitCommit
            {
                message = "Update from Markpad",
                parents = new[] {shaLatestCommit},
                tree = gitTree.sha
            };
            var url = string.Format("/repos/{0}/{1}/git/commits", username, repository);
            var respose = await client.PostAsJsonAsync(GetUrl(url, token), gitCommit);

            var content = await respose.Content.ReadAsAsync<dynamic>();
            gitCommit.sha = content.sha;
            return gitCommit;
        }