Commit f000ee4e5b840e9f110123a050777fb1301b19bf

Carlos Martín Nieto 2014-01-24T18:23:46

tree: remove legacy 'oid' naming Rename git_tree_entry_byoid() to _byid() as per the convention.

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;
 	}