summaryrefslogtreecommitdiff
path: root/src/notes.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-11-30 12:52:42 -0800
committerBen Straub <bs@github.com>2012-11-30 13:12:16 -0800
commit4ec197f3049d203739066e0c2d2c5c39f78fd808 (patch)
tree94637d0def9f59554fd59efdaaec283e34dd9c26 /src/notes.c
parent10711769000d009189f83e468f25b719fa303086 (diff)
downloadlibgit2-4ec197f3049d203739066e0c2d2c5c39f78fd808.tar.gz
Deploy GIT_SIGNATURE_INIT
Diffstat (limited to 'src/notes.c')
-rw-r--r--src/notes.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/notes.c b/src/notes.c
index dd36cc2fe..87ee1e742 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -11,6 +11,7 @@
#include "refs.h"
#include "config.h"
#include "iterator.h"
+#include "signature.h"
static int find_subtree_in_current_level(
git_tree **out,
@@ -455,6 +456,10 @@ int git_note_create(
git_commit *commit = NULL;
git_tree *tree = NULL;
+ if (!git_signature__has_valid_version(author) ||
+ !git_signature__has_valid_version(committer))
+ return -1;
+
target = git_oid_allocfmt(oid);
GITERR_CHECK_ALLOC(target);
@@ -482,6 +487,10 @@ int git_note_remove(git_repository *repo, const char *notes_ref,
git_commit *commit = NULL;
git_tree *tree = NULL;
+ if (!git_signature__has_valid_version(author) ||
+ !git_signature__has_valid_version(committer))
+ return -1;
+
target = git_oid_allocfmt(oid);
GITERR_CHECK_ALLOC(target);