Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
0ecf0e33
Unverified
Commit
0ecf0e33
authored
Jun 16, 2018
by
Edward Thomson
Committed by
GitHub
Jun 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4683 from pks-t/pks/tree-unused-functions
tree: remove unused functions
parents
678fa45b
f0a1d76a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
55 deletions
+0
-55
src/tree.c
+0
-43
src/tree.h
+0
-12
No files found.
src/tree.c
View file @
0ecf0e33
...
...
@@ -74,14 +74,6 @@ int git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entry *e2)
return
entry_sort_cmp
(
e1
,
e2
);
}
int
git_tree_entry_icmp
(
const
git_tree_entry
*
e1
,
const
git_tree_entry
*
e2
)
{
return
git_path_cmp
(
e1
->
filename
,
e1
->
filename_len
,
git_tree_entry__is_tree
(
e1
),
e2
->
filename
,
e2
->
filename_len
,
git_tree_entry__is_tree
(
e2
),
git__strncasecmp
);
}
/**
* Allocate a new self-contained entry, with enough space after it to
* store the filename and the id.
...
...
@@ -342,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
);
...
...
src/tree.h
View file @
0ecf0e33
...
...
@@ -39,22 +39,10 @@ GIT_INLINE(bool) git_tree_entry__is_tree(const struct git_tree_entry *e)
return
(
S_ISDIR
(
e
->
attr
)
&&
!
S_ISGITLINK
(
e
->
attr
));
}
extern
int
git_tree_entry_icmp
(
const
git_tree_entry
*
e1
,
const
git_tree_entry
*
e2
);
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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment