Skip to content

Commit d7e8a2e

Browse files
shiftkeynulltoken
authored andcommitted
Drop optional parameters in CommitRewriteInfo.cs
1 parent 0cfa923 commit d7e8a2e

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

LibGit2Sharp/CommitRewriteInfo.cs

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,46 @@ public static CommitRewriteInfo From(Commit commit)
3535
};
3636
}
3737

38+
/// <summary>
39+
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
40+
/// optionally overriding some of its properties
41+
/// </summary>
42+
/// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param>
43+
/// <param name="author">Optional override for the author</param>
44+
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
45+
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
46+
public static CommitRewriteInfo From(Commit commit, Signature author)
47+
{
48+
return From(commit, author, null, null);
49+
}
50+
51+
/// <summary>
52+
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
53+
/// optionally overriding some of its properties
54+
/// </summary>
55+
/// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param>
56+
/// <param name="message">Optional override for the message</param>
57+
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
58+
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
59+
public static CommitRewriteInfo From(Commit commit, string message)
60+
{
61+
return From(commit, null, null, message);
62+
}
63+
64+
/// <summary>
65+
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
66+
/// optionally overriding some of its properties
67+
/// </summary>
68+
/// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param>
69+
/// <param name="author">Optional override for the author</param>
70+
/// <param name="committer">Optional override for the committer</param>
71+
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
72+
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
73+
public static CommitRewriteInfo From(Commit commit, Signature author, Signature committer)
74+
{
75+
return From(commit, author, committer, null);
76+
}
77+
3878
/// <summary>
3979
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
4080
/// optionally overriding some of its properties
@@ -46,9 +86,9 @@ public static CommitRewriteInfo From(Commit commit)
4686
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
4787
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
4888
public static CommitRewriteInfo From(Commit commit,
49-
Signature author = null,
50-
Signature committer = null,
51-
string message = null)
89+
Signature author,
90+
Signature committer,
91+
string message)
5292
{
5393
var cri = From(commit);
5494
cri.Author = author ?? cri.Author;

0 commit comments

Comments
 (0)