Skip to content

Commit a687471

Browse files
committed
Obsolete NoteCollection.Add() overload that do not require Signature parameters
1 parent b69e3e2 commit a687471

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

LibGit2Sharp.Tests/NoteFixture.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ public void CanAddANoteWithSignatureFromConfig()
175175
using (var repo = new Repository(path, options))
176176
{
177177
var commit = repo.Lookup<Commit>("9fd738e8f7967c078dceed8190330fc8648ee56a");
178-
var note = repo.Notes.Add(commit.Id, "I'm batman!\n", "batmobile");
178+
179+
Signature signature = repo.Config.BuildSignature(DateTimeOffset.Now);
180+
181+
var note = repo.Notes.Add(commit.Id, "I'm batman!\n", signature, signature, "batmobile");
179182

180183
var newNote = commit.Notes.Single();
181184
Assert.Equal(note, newNote);

LibGit2Sharp/NoteCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ internal static string UnCanonicalizeName(string name)
171171
/// <param name="message">The note message.</param>
172172
/// <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>
173173
/// <returns>The note which was just saved.</returns>
174+
[Obsolete("This method will be removed in the next release. Please use Add(ObjectId, string, Signature, Signature, string) instead.")]
174175
public virtual Note Add(ObjectId targetId, string message, string @namespace)
175176
{
176177
Signature author = repo.Config.BuildSignatureOrThrow(DateTimeOffset.Now);

0 commit comments

Comments
 (0)