Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LibGit2Sharp/CommitRewriteInfo.cs46
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;