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:
authorKeith Dahlby <dahlbyk@gmail.com>2012-06-07 14:14:42 +0400
committerKeith Dahlby <dahlbyk@gmail.com>2012-06-10 01:16:21 +0400
commite408fb59d4d8222ee2105bce5e2678dd4868ce49 (patch)
treef45593bcbe0831723d90f8bb97a21842ca43e076 /LibGit2Sharp/RemoteCollection.cs
parent21a4b4e80fd260874c7813fe754759ef77888458 (diff)
Rename Create to Add in RemoteCollection
Diffstat (limited to 'LibGit2Sharp/RemoteCollection.cs')
-rw-r--r--LibGit2Sharp/RemoteCollection.cs37
1 files changed, 33 insertions, 4 deletions
diff --git a/LibGit2Sharp/RemoteCollection.cs b/LibGit2Sharp/RemoteCollection.cs
index e40ccd37..799edc79 100644
--- a/LibGit2Sharp/RemoteCollection.cs
+++ b/LibGit2Sharp/RemoteCollection.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using LibGit2Sharp.Core;
@@ -82,11 +83,26 @@ namespace LibGit2Sharp
/// <param name = "name">The name of the remote to create.</param>
/// <param name = "url">The location of the repository.</param>
/// <returns>A new <see cref = "Remote" />.</returns>
- public Remote Create(string name, string url)
+ public Remote Add(string name, string url)
{
string fetchRefSpec = string.Format("+refs/heads/*:refs/remotes/{0}/*", name);
- return Create(name, url, fetchRefSpec);
+ return Add(name, url, fetchRefSpec);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="Remote"/> with the specified name and for the repository at the specified location.
+ /// <para>
+ /// A default fetch refspec will be added for this remote.
+ /// </para>
+ /// </summary>
+ /// <param name = "name">The name of the remote to create.</param>
+ /// <param name = "url">The location of the repository.</param>
+ /// <returns>A new <see cref = "Remote" />.</returns>
+ [Obsolete("This method will be removed in the next release. Please use Add() instead.")]
+ public Remote Create(string name, string url)
+ {
+ return Add(name, url);
}
/// <summary>
@@ -96,7 +112,7 @@ namespace LibGit2Sharp
/// <param name = "url">The location of the repository.</param>
/// <param name = "fetchRefSpec">The refSpec to be used when fetching from this remote..</param>
/// <returns>A new <see cref = "Remote" />.</returns>
- public Remote Create(string name, string url, string fetchRefSpec)
+ public Remote Add(string name, string url, string fetchRefSpec)
{
Ensure.ArgumentNotNull(name, "name");
Ensure.ArgumentNotNull(url, "url");
@@ -115,5 +131,18 @@ namespace LibGit2Sharp
return Remote.CreateFromPtr(handle);
}
}
+
+ /// <summary>
+ /// Creates a <see cref="Remote"/> with the specified name and for the repository at the specified location.
+ /// </summary>
+ /// <param name = "name">The name of the remote to create.</param>
+ /// <param name = "url">The location of the repository.</param>
+ /// <param name = "fetchRefSpec">The refSpec to be used when fetching from this remote..</param>
+ /// <returns>A new <see cref = "Remote" />.</returns>
+ [Obsolete("This method will be removed in the next release. Please use Add() instead.")]
+ public Remote Create(string name, string url, string fetchRefSpec)
+ {
+ return Add(name, url);
+ }
}
}