note: rename the id getter to git_note_id() This was left over when we did the general switch.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
diff --git a/include/git2/notes.h b/include/git2/notes.h
index 0cb6ce5..98eb2ae 100644
--- a/include/git2/notes.h
+++ b/include/git2/notes.h
@@ -106,12 +106,12 @@ GIT_EXTERN(const char *) git_note_message(const git_note *note);
/**
- * Get the note object OID
+ * Get the note object's id
*
* @param note the note
- * @return the note object OID
+ * @return the note object's id
*/
-GIT_EXTERN(const git_oid *) git_note_oid(const git_note *note);
+GIT_EXTERN(const git_oid *) git_note_id(const git_note *note);
/**
* Add a note for an object
diff --git a/src/notes.c b/src/notes.c
index 7959049..1ff0e35 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -313,7 +313,7 @@ static int note_new(git_note **out, git_oid *note_oid, git_blob *blob)
note = (git_note *)git__malloc(sizeof(git_note));
GITERR_CHECK_ALLOC(note);
- git_oid_cpy(¬e->oid, note_oid);
+ git_oid_cpy(¬e->id, note_oid);
note->message = git__strdup((char *)git_blob_rawcontent(blob));
GITERR_CHECK_ALLOC(note->message);
@@ -508,10 +508,10 @@ const char * git_note_message(const git_note *note)
return note->message;
}
-const git_oid * git_note_oid(const git_note *note)
+const git_oid * git_note_id(const git_note *note)
{
assert(note);
- return ¬e->oid;
+ return ¬e->id;
}
void git_note_free(git_note *note)
diff --git a/src/notes.h b/src/notes.h
index 39e18b6..e9cfa00 100644
--- a/src/notes.h
+++ b/src/notes.h
@@ -21,7 +21,7 @@
"Notes removed by 'git_note_remove' from libgit2"
struct git_note {
- git_oid oid;
+ git_oid id;
char *message;
};
diff --git a/tests/notes/notes.c b/tests/notes/notes.c
index c2579a2..e48d9df 100644
--- a/tests/notes/notes.c
+++ b/tests/notes/notes.c
@@ -21,7 +21,7 @@ static void assert_note_equal(git_note *note, char *message, git_oid *note_oid)
git_blob *blob;
cl_assert_equal_s(git_note_message(note), message);
- cl_assert(!git_oid_cmp(git_note_oid(note), note_oid));
+ cl_assert(!git_oid_cmp(git_note_id(note), note_oid));
cl_git_pass(git_blob_lookup(&blob, _repo, note_oid));
cl_assert_equal_s(git_note_message(note), (const char *)git_blob_rawcontent(blob));
@@ -290,7 +290,7 @@ void test_notes_notes__can_read_a_note_in_an_existing_fanout(void)
cl_git_pass(git_note_read(¬e, _repo, "refs/notes/fanout", &target_oid));
cl_git_pass(git_oid_fromstr(¬e_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
- cl_assert(!git_oid_cmp(git_note_oid(note), ¬e_oid));
+ cl_assert(!git_oid_cmp(git_note_id(note), ¬e_oid));
git_note_free(note);
}
diff --git a/tests/notes/notesref.c b/tests/notes/notesref.c
index c89b71b..a331419 100644
--- a/tests/notes/notesref.c
+++ b/tests/notes/notesref.c
@@ -46,13 +46,13 @@ void test_notes_notesref__config_corenotesref(void)
cl_git_pass(git_note_read(&_note, _repo, NULL, &oid));
cl_assert_equal_s("test123test\n", git_note_message(_note));
- cl_assert(!git_oid_cmp(git_note_oid(_note), ¬e_oid));
+ cl_assert(!git_oid_cmp(git_note_id(_note), ¬e_oid));
git_note_free(_note);
cl_git_pass(git_note_read(&_note, _repo, "refs/notes/mydefaultnotesref", &oid));
cl_assert_equal_s("test123test\n", git_note_message(_note));
- cl_assert(!git_oid_cmp(git_note_oid(_note), ¬e_oid));
+ cl_assert(!git_oid_cmp(git_note_id(_note), ¬e_oid));
cl_git_pass(git_note_default_ref(&default_ref, _repo));
cl_assert_equal_s("refs/notes/mydefaultnotesref", default_ref);