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:
authorBrendan Forster <brendan@github.com>2015-05-10 14:02:12 +0300
committernulltoken <emeric.fermas@gmail.com>2015-05-15 20:31:46 +0300
commitb3386c995f88d88b43b21788c20890de55bf795e (patch)
treee3bacf129dbd8f5ebc0e1bf091ab766afe96af80
parentd7e8a2e915f46c521dbff1b788bed2cb4fbd91bf (diff)
Drop optional parameters in BranchCollectionExtensions.cs
-rw-r--r--LibGit2Sharp/BranchCollectionExtensions.cs39
1 files changed, 36 insertions, 3 deletions
diff --git a/LibGit2Sharp/BranchCollectionExtensions.cs b/LibGit2Sharp/BranchCollectionExtensions.cs
index cea02c7a..68b15dec 100644
--- a/LibGit2Sharp/BranchCollectionExtensions.cs
+++ b/LibGit2Sharp/BranchCollectionExtensions.cs
@@ -13,15 +13,36 @@ namespace LibGit2Sharp
/// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
/// <param name="name">The name of the branch.</param>
/// <param name="commit">The target commit.</param>
+ /// <returns>A new <see cref="Branch"/>.</returns>
+ public static Branch Add(this BranchCollection branches, string name, Commit commit)
+ {
+ return branches.Add(name, commit, false);
+ }
+
+ /// <summary>
+ /// Create a new local branch with the specified name
+ /// </summary>
+ /// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
+ /// <param name="name">The name of the branch.</param>
+ /// <param name="commit">The target commit.</param>
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing branch, false otherwise.</param>
/// <returns>A new <see cref="Branch"/>.</returns>
- public static Branch Add(this BranchCollection branches, string name, Commit commit, bool allowOverwrite = false)
+ public static Branch Add(this BranchCollection branches, string name, Commit commit, bool allowOverwrite)
{
Ensure.ArgumentNotNull(commit, "commit");
return branches.Add(name, commit.Sha, allowOverwrite);
}
+ /// <summary>
+ /// Deletes the branch with the specified name.
+ /// </summary>
+ /// <param name="name">The name of the branch to delete.</param>
+ /// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
+ public static void Remove(this BranchCollection branches, string name)
+ {
+ branches.Remove(name, false);
+ }
/// <summary>
/// Deletes the branch with the specified name.
@@ -29,7 +50,7 @@ namespace LibGit2Sharp
/// <param name="name">The name of the branch to delete.</param>
/// <param name="isRemote">True if the provided <paramref name="name"/> is the name of a remote branch, false otherwise.</param>
/// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
- public static void Remove(this BranchCollection branches, string name, bool isRemote = false)
+ public static void Remove(this BranchCollection branches, string name, bool isRemote)
{
Ensure.ArgumentNotNullOrEmptyString(name, "name");
@@ -50,10 +71,22 @@ namespace LibGit2Sharp
/// </summary>
/// <param name="currentName">The current branch name.</param>
/// <param name="newName">The new name the existing branch should bear.</param>
+ /// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
+ /// <returns>A new <see cref="Branch"/>.</returns>
+ public static Branch Rename(this BranchCollection branches, string currentName, string newName)
+ {
+ return branches.Rename(currentName, newName, false);
+ }
+
+ /// <summary>
+ /// Rename an existing local branch, using the default reflog message
+ /// </summary>
+ /// <param name="currentName">The current branch name.</param>
+ /// <param name="newName">The new name the existing branch should bear.</param>
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing branch, false otherwise.</param>
/// <param name="branches">The <see cref="BranchCollection"/> being worked with.</param>
/// <returns>A new <see cref="Branch"/>.</returns>
- public static Branch Rename(this BranchCollection branches, string currentName, string newName, bool allowOverwrite = false)
+ public static Branch Rename(this BranchCollection branches, string currentName, string newName, bool allowOverwrite)
{
Ensure.ArgumentNotNullOrEmptyString(currentName, "currentName");
Ensure.ArgumentNotNullOrEmptyString(newName, "newName");