Skip to content

Commit 0ecf0e3

Browse files
authored
Merge pull request libgit2#4683 from pks-t/pks/tree-unused-functions
tree: remove unused functions
2 parents 678fa45 + f0a1d76 commit 0ecf0e3

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

src/tree.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,6 @@ int git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entry *e2)
7474
return entry_sort_cmp(e1, e2);
7575
}
7676

77-
int git_tree_entry_icmp(const git_tree_entry *e1, const git_tree_entry *e2)
78-
{
79-
return git_path_cmp(
80-
e1->filename, e1->filename_len, git_tree_entry__is_tree(e1),
81-
e2->filename, e2->filename_len, git_tree_entry__is_tree(e2),
82-
git__strncasecmp);
83-
}
84-
8577
/**
8678
* Allocate a new self-contained entry, with enough space after it to
8779
* store the filename and the id.
@@ -342,41 +334,6 @@ const git_tree_entry *git_tree_entry_byid(
342334
return NULL;
343335
}
344336

345-
int git_tree__prefix_position(const git_tree *tree, const char *path)
346-
{
347-
struct tree_key_search ksearch;
348-
size_t at_pos, path_len;
349-
350-
if (!path)
351-
return 0;
352-
353-
path_len = strlen(path);
354-
TREE_ENTRY_CHECK_NAMELEN(path_len);
355-
356-
ksearch.filename = path;
357-
ksearch.filename_len = (uint16_t)path_len;
358-
359-
/* Find tree entry with appropriate prefix */
360-
git_array_search(
361-
&at_pos, tree->entries, &homing_search_cmp, &ksearch);
362-
363-
for (; at_pos < tree->entries.size; ++at_pos) {
364-
const git_tree_entry *entry = git_array_get(tree->entries, at_pos);
365-
if (homing_search_cmp(&ksearch, entry) < 0)
366-
break;
367-
}
368-
369-
for (; at_pos > 0; --at_pos) {
370-
const git_tree_entry *entry =
371-
git_array_get(tree->entries, at_pos - 1);
372-
373-
if (homing_search_cmp(&ksearch, entry) > 0)
374-
break;
375-
}
376-
377-
return (int)at_pos;
378-
}
379-
380337
size_t git_tree_entrycount(const git_tree *tree)
381338
{
382339
assert(tree);

src/tree.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,9 @@ GIT_INLINE(bool) git_tree_entry__is_tree(const struct git_tree_entry *e)
3939
return (S_ISDIR(e->attr) && !S_ISGITLINK(e->attr));
4040
}
4141

42-
extern int git_tree_entry_icmp(const git_tree_entry *e1, const git_tree_entry *e2);
43-
4442
void git_tree__free(void *tree);
4543
int git_tree__parse(void *tree, git_odb_object *obj);
4644

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

0 commit comments

Comments
 (0)