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:
authornulltoken <emeric.fermas@gmail.com>2015-06-18 16:20:45 +0300
committernulltoken <emeric.fermas@gmail.com>2015-06-18 18:45:18 +0300
commit265a9e995181b8f605d8a382bb1b76d2fabceaa0 (patch)
treeba1328207991ac9a0c1e51da0ef2d7a6c4d201ce
parentdb043abf01af3cce339d10954262f70c29d70390 (diff)
Fold NoteCollectionExtensions.cs into NoteCollection.cs
-rw-r--r--LibGit2Sharp/LibGit2Sharp.csproj1
-rw-r--r--LibGit2Sharp/NoteCollection.cs28
-rw-r--r--LibGit2Sharp/NoteCollectionExtensions.cs40
3 files changed, 28 insertions, 41 deletions
diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj
index 6c54080f..fd252f64 100644
--- a/LibGit2Sharp/LibGit2Sharp.csproj
+++ b/LibGit2Sharp/LibGit2Sharp.csproj
@@ -147,7 +147,6 @@
<Compile Include="MergeFetchHeadNotFoundException.cs" />
<Compile Include="RepositoryOperationContext.cs" />
<Compile Include="ResetMode.cs" />
- <Compile Include="NoteCollectionExtensions.cs" />
<Compile Include="RefSpecDirection.cs" />
<Compile Include="Core\GitStatusEntry.cs" />
<Compile Include="Core\GitStatusOptions.cs" />
diff --git a/LibGit2Sharp/NoteCollection.cs b/LibGit2Sharp/NoteCollection.cs
index 6a2a947c..8ea0a0fe 100644
--- a/LibGit2Sharp/NoteCollection.cs
+++ b/LibGit2Sharp/NoteCollection.cs
@@ -167,6 +167,21 @@ namespace LibGit2Sharp
/// <summary>
/// Creates or updates a <see cref="Note"/> on the specified object, and for the given namespace.
+ /// <para>Both the Author and Committer will be guessed from the Git configuration. An exception will be raised if no configuration is reachable.</para>
+ /// </summary>
+ /// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
+ /// <param name="message">The note message.</param>
+ /// <param name="namespace">The namespace on which the note will be created. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace').</param>
+ /// <returns>The note which was just saved.</returns>
+ public virtual Note Add(ObjectId targetId, string message, string @namespace)
+ {
+ Signature author = repo.Config.BuildSignature(DateTimeOffset.Now, true);
+
+ return Add(targetId, message, author, author, @namespace);
+ }
+
+ /// <summary>
+ /// Creates or updates a <see cref="Note"/> on the specified object, and for the given namespace.
/// </summary>
/// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
/// <param name="message">The note message.</param>
@@ -193,6 +208,19 @@ namespace LibGit2Sharp
/// <summary>
/// Deletes the note on the specified object, and for the given namespace.
+ /// <para>Both the Author and Committer will be guessed from the Git configuration. An exception will be raised if no configuration is reachable.</para>
+ /// </summary>
+ /// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
+ /// <param name="namespace">The namespace on which the note will be removed. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace').</param>
+ public virtual void Remove(ObjectId targetId, string @namespace)
+ {
+ Signature author = repo.Config.BuildSignature(DateTimeOffset.Now, true);
+
+ Remove(targetId, author, author, @namespace);
+ }
+
+ /// <summary>
+ /// Deletes the note on the specified object, and for the given namespace.
/// </summary>
/// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
/// <param name="author">The author.</param>
diff --git a/LibGit2Sharp/NoteCollectionExtensions.cs b/LibGit2Sharp/NoteCollectionExtensions.cs
deleted file mode 100644
index 3a2f78e2..00000000
--- a/LibGit2Sharp/NoteCollectionExtensions.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-
-namespace LibGit2Sharp
-{
- /// <summary>
- /// Provides helper overloads to a <see cref="NoteCollection"/>.
- /// </summary>
- public static class NoteCollectionExtensions
- {
- /// <summary>
- /// Creates or updates a <see cref="Note"/> on the specified object, and for the given namespace.
- /// <para>Both the Author and Committer will be guessed from the Git configuration. An exception will be raised if no configuration is reachable.</para>
- /// </summary>
- /// <param name="collection">The <see cref="NoteCollection"/></param>
- /// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
- /// <param name="message">The note message.</param>
- /// <param name="namespace">The namespace on which the note will be created. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace').</param>
- /// <returns>The note which was just saved.</returns>
- public static Note Add(this NoteCollection collection, ObjectId targetId, string message, string @namespace)
- {
- Signature author = collection.repo.Config.BuildSignature(DateTimeOffset.Now, true);
-
- return collection.Add(targetId, message, author, author, @namespace);
- }
-
- /// <summary>
- /// Deletes the note on the specified object, and for the given namespace.
- /// <para>Both the Author and Committer will be guessed from the Git configuration. An exception will be raised if no configuration is reachable.</para>
- /// </summary>
- /// <param name="collection">The <see cref="NoteCollection"/></param>
- /// <param name="targetId">The target <see cref="ObjectId"/>, for which the note will be created.</param>
- /// <param name="namespace">The namespace on which the note will be removed. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace').</param>
- public static void Remove(this NoteCollection collection, ObjectId targetId, string @namespace)
- {
- Signature author = collection.repo.Config.BuildSignature(DateTimeOffset.Now, true);
-
- collection.Remove(targetId, author, author, @namespace);
- }
- }
-}