tree: remove legacy 'oid' naming Rename git_tree_entry_byoid() to _byid() as per the convention.
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
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 6350ada..6669652 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -121,11 +121,11 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(
* Warning: this must examine every entry in the tree, so it is not fast.
*
* @param tree a previously loaded tree.
- * @param oid the sha being looked for
+ * @param id the sha being looked for
* @return the tree entry; NULL if not found
*/
-GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(
- const git_tree *tree, const git_oid *oid);
+GIT_EXTERN(const git_tree_entry *) git_tree_entry_byid(
+ const git_tree *tree, const git_oid *id);
/**
* Retrieve a tree entry contained in a tree or in any of its subtrees,
diff --git a/src/tree.c b/src/tree.c
index 3fb544e..877a3fc 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -305,8 +305,8 @@ const git_tree_entry *git_tree_entry_byindex(
return git_vector_get(&tree->entries, idx);
}
-const git_tree_entry *git_tree_entry_byoid(
- const git_tree *tree, const git_oid *oid)
+const git_tree_entry *git_tree_entry_byid(
+ const git_tree *tree, const git_oid *id)
{
size_t i;
const git_tree_entry *e;
@@ -314,7 +314,7 @@ const git_tree_entry *git_tree_entry_byoid(
assert(tree);
git_vector_foreach(&tree->entries, i, e) {
- if (memcmp(&e->oid.id, &oid->id, sizeof(oid->id)) == 0)
+ if (memcmp(&e->oid.id, &id->id, sizeof(id->id)) == 0)
return e;
}