Skip to content

Commit f0a1d76

Browse files
committed
tree: remove unused function git_tree__prefix_position
1 parent 31f6b52 commit f0a1d76

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/tree.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -334,41 +334,6 @@ const git_tree_entry *git_tree_entry_byid(
334334
return NULL;
335335
}
336336

337-
int git_tree__prefix_position(const git_tree *tree, const char *path)
338-
{
339-
struct tree_key_search ksearch;
340-
size_t at_pos, path_len;
341-
342-
if (!path)
343-
return 0;
344-
345-
path_len = strlen(path);
346-
TREE_ENTRY_CHECK_NAMELEN(path_len);
347-
348-
ksearch.filename = path;
349-
ksearch.filename_len = (uint16_t)path_len;
350-
351-
/* Find tree entry with appropriate prefix */
352-
git_array_search(
353-
&at_pos, tree->entries, &homing_search_cmp, &ksearch);
354-
355-
for (; at_pos < tree->entries.size; ++at_pos) {
356-
const git_tree_entry *entry = git_array_get(tree->entries, at_pos);
357-
if (homing_search_cmp(&ksearch, entry) < 0)
358-
break;
359-
}
360-
361-
for (; at_pos > 0; --at_pos) {
362-
const git_tree_entry *entry =
363-
git_array_get(tree->entries, at_pos - 1);
364-
365-
if (homing_search_cmp(&ksearch, entry) > 0)
366-
break;
367-
}
368-
369-
return (int)at_pos;
370-
}
371-
372337
size_t git_tree_entrycount(const git_tree *tree)
373338
{
374339
assert(tree);

src/tree.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ GIT_INLINE(bool) git_tree_entry__is_tree(const struct git_tree_entry *e)
4242
void git_tree__free(void *tree);
4343
int git_tree__parse(void *tree, git_odb_object *obj);
4444

45-
/**
46-
* Lookup the first position in the tree with a given prefix.
47-
*
48-
* @param tree a previously loaded tree.
49-
* @param prefix the beginning of a path to find in the tree.
50-
* @return index of the first item at or after the given prefix.
51-
*/
52-
int git_tree__prefix_position(const git_tree *tree, const char *prefix);
53-
54-
5545
/**
5646
* Write a tree to the given repository
5747
*/

0 commit comments

Comments
 (0)