CreateCommit() public static method

Returns the Uri for creating a commit object.
public static CreateCommit ( long repositoryId ) : Uri
repositoryId long The Id of the repository
return System.Uri
Example #1
0
        /// <summary>
        /// Create a commit for a given repository
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/commits/#create-a-commit
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="commit">The commit to create</param>
        /// <returns></returns>
        public Task <Commit> Create(string owner, string name, NewCommit commit)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(commit, "commit");

            return(ApiConnection.Post <Commit>(ApiUrls.CreateCommit(owner, name), commit));
        }
Example #2
0
        /// <summary>
        /// Create a commit for a given repository
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/commits/#create-a-commit
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="commit">The commit to create</param>
        public Task <Commit> Create(long repositoryId, NewCommit commit)
        {
            Ensure.ArgumentNotNull(commit, "commit");

            return(ApiConnection.Post <Commit>(ApiUrls.CreateCommit(repositoryId), commit));
        }