From d7e8a2e915f46c521dbff1b788bed2cb4fbd91bf Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 10 May 2015 13:01:07 +0200 Subject: Drop optional parameters in CommitRewriteInfo.cs --- LibGit2Sharp/CommitRewriteInfo.cs | 46 ++++++++++++++++++++++++++++++++++++--- 1 file 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 }; } + /// + /// Build a from the passed in, + /// optionally overriding some of its properties + /// + /// The whose information is to be copied + /// Optional override for the author + /// A new object that matches the info for the + /// with the optional parameters replaced.. + public static CommitRewriteInfo From(Commit commit, Signature author) + { + return From(commit, author, null, null); + } + + /// + /// Build a from the passed in, + /// optionally overriding some of its properties + /// + /// The whose information is to be copied + /// Optional override for the message + /// A new object that matches the info for the + /// with the optional parameters replaced.. + public static CommitRewriteInfo From(Commit commit, string message) + { + return From(commit, null, null, message); + } + + /// + /// Build a from the passed in, + /// optionally overriding some of its properties + /// + /// The whose information is to be copied + /// Optional override for the author + /// Optional override for the committer + /// A new object that matches the info for the + /// with the optional parameters replaced.. + public static CommitRewriteInfo From(Commit commit, Signature author, Signature committer) + { + return From(commit, author, committer, null); + } + /// /// Build a from the passed in, /// optionally overriding some of its properties @@ -46,9 +86,9 @@ namespace LibGit2Sharp /// A new object that matches the info for the /// with the optional parameters replaced.. 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; -- cgit v1.2.3