tree: remove unused function `git_tree__prefix_position`
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
diff --git a/src/tree.c b/src/tree.c
index 2c5a6b6..be0f528 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -334,41 +334,6 @@ const git_tree_entry *git_tree_entry_byid(
return NULL;
}
-int git_tree__prefix_position(const git_tree *tree, const char *path)
-{
- struct tree_key_search ksearch;
- size_t at_pos, path_len;
-
- if (!path)
- return 0;
-
- path_len = strlen(path);
- TREE_ENTRY_CHECK_NAMELEN(path_len);
-
- ksearch.filename = path;
- ksearch.filename_len = (uint16_t)path_len;
-
- /* Find tree entry with appropriate prefix */
- git_array_search(
- &at_pos, tree->entries, &homing_search_cmp, &ksearch);
-
- for (; at_pos < tree->entries.size; ++at_pos) {
- const git_tree_entry *entry = git_array_get(tree->entries, at_pos);
- if (homing_search_cmp(&ksearch, entry) < 0)
- break;
- }
-
- for (; at_pos > 0; --at_pos) {
- const git_tree_entry *entry =
- git_array_get(tree->entries, at_pos - 1);
-
- if (homing_search_cmp(&ksearch, entry) > 0)
- break;
- }
-
- return (int)at_pos;
-}
-
size_t git_tree_entrycount(const git_tree *tree)
{
assert(tree);
diff --git a/src/tree.h b/src/tree.h
index 25b208a..fbee5ef 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -43,16 +43,6 @@ void git_tree__free(void *tree);
int git_tree__parse(void *tree, git_odb_object *obj);
/**
- * Lookup the first position in the tree with a given prefix.
- *
- * @param tree a previously loaded tree.
- * @param prefix the beginning of a path to find in the tree.
- * @return index of the first item at or after the given prefix.
- */
-int git_tree__prefix_position(const git_tree *tree, const char *prefix);
-
-
-/**
* Write a tree to the given repository
*/
int git_tree__write_index(