diff options
author | Brendan Forster <brendan@github.com> | 2015-05-10 14:01:07 +0300 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-05-15 20:31:45 +0300 |
commit | d7e8a2e915f46c521dbff1b788bed2cb4fbd91bf (patch) | |
tree | 576c3c6c31139889a3a492ad064317fe477f9282 | |
parent | 0cfa9230e00d340805223a81a165769fb72a744c (diff) |
Drop optional parameters in CommitRewriteInfo.cs
-rw-r--r-- | LibGit2Sharp/CommitRewriteInfo.cs | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/LibGit2Sharp/CommitRewriteInfo.cs b/LibGit2Sharp/CommitRewriteInfo.cs index 5e0a5caa..a4387e83 100644 --- a/LibGit2Sharp/CommitRewriteInfo.cs +++ b/LibGit2Sharp/CommitRewriteInfo.cs @@ -35,6 +35,46 @@ namespace LibGit2Sharp }; } + /// <summary> + /// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in, + /// optionally overriding some of its properties + /// </summary> + /// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param> + /// <param name="author">Optional override for the author</param> + /// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the + /// <paramref name="commit"/> with the optional parameters replaced..</returns> + public static CommitRewriteInfo From(Commit commit, Signature author) + { + return From(commit, author, null, null); + } + + /// <summary> + /// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in, + /// optionally overriding some of its properties + /// </summary> + /// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param> + /// <param name="message">Optional override for the message</param> + /// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the + /// <paramref name="commit"/> with the optional parameters replaced..</returns> + public static CommitRewriteInfo From(Commit commit, string message) + { + return From(commit, null, null, message); + } + + /// <summary> + /// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in, + /// optionally overriding some of its properties + /// </summary> + /// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param> + /// <param name="author">Optional override for the author</param> + /// <param name="committer">Optional override for the committer</param> + /// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the + /// <paramref name="commit"/> with the optional parameters replaced..</returns> + public static CommitRewriteInfo From(Commit commit, Signature author, Signature committer) + { + return From(commit, author, committer, null); + } + /// <summary> /// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in, /// optionally overriding some of its properties @@ -46,9 +86,9 @@ namespace LibGit2Sharp /// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the /// <paramref name="commit"/> with the optional parameters replaced..</returns> public static CommitRewriteInfo From(Commit commit, - Signature author = null, - Signature committer = null, - string message = null) + Signature author, + Signature committer, + string message) { var cri = From(commit); cri.Author = author ?? cri.Author; |