diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-05-25 14:55:51 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-05-26 21:07:38 +0400 |
commit | 8b13ff3a89d40fef94974facf52d578f11feba52 (patch) | |
tree | 01103eb0adb033d54ecf26dc8a34594e039a913c /LibGit2Sharp/ObjectDatabase.cs | |
parent | 96df5f8d6d3e35f8aadafdc25a95ede3eb9e86b5 (diff) |
Introduce repo.ObjectDatabase.CreateTag()
Diffstat (limited to 'LibGit2Sharp/ObjectDatabase.cs')
-rw-r--r-- | LibGit2Sharp/ObjectDatabase.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs index 7db7502b..8b4795f1 100644 --- a/LibGit2Sharp/ObjectDatabase.cs +++ b/LibGit2Sharp/ObjectDatabase.cs @@ -159,5 +159,22 @@ namespace LibGit2Sharp return repo.Lookup<Commit>(commitId); } + + /// <summary> + /// Inserts a <see cref = "TagAnnotation"/> into the object database, pointing to a specific <see cref = "GitObject"/>. + /// </summary> + /// <param name="name">The name.</param> + /// <param name="target">The <see cref="GitObject"/> being pointed at.</param> + /// <param name="tagger">The tagger.</param> + /// <param name="message">The message.</param> + /// <returns>The created <see cref = "Commit"/>.</returns> + public virtual TagAnnotation CreateTag(string name, GitObject target, Signature tagger, string message) + { + string prettifiedMessage = Proxy.git_message_prettify(message); + + ObjectId tagId = Proxy.git_tag_annotation_create(repo.Handle, name, target, tagger, prettifiedMessage); + + return repo.Lookup<TagAnnotation>(tagId); + } } } |