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
a26a1563
Commit
a26a1563
authored
Dec 30, 2011
by
Clemens Buchacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move entry_is_tree to tree.h
parent
e632f687
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
src/tree.c
+4
-6
src/tree.h
+5
-0
No files found.
src/tree.c
View file @
a26a1563
...
...
@@ -15,8 +15,6 @@
#define MAX_FILEMODE 0777777
#define MAX_FILEMODE_BYTES 6
#define ENTRY_IS_TREE(e) ((e)->attr & 040000)
static
int
valid_attributes
(
const
int
attributes
)
{
return
attributes
>=
0
&&
attributes
<=
MAX_FILEMODE
;
...
...
@@ -33,8 +31,8 @@ static int entry_sort_cmp(const void *a, const void *b)
const
git_tree_entry
*
entry_b
=
(
const
git_tree_entry
*
)(
b
);
return
git_futils_cmp_path
(
entry_a
->
filename
,
entry_a
->
filename_len
,
ENTRY_IS_TREE
(
entry_a
),
entry_b
->
filename
,
entry_b
->
filename_len
,
ENTRY_IS_TREE
(
entry_b
));
entry_a
->
filename
,
entry_a
->
filename_len
,
entry_is_tree
(
entry_a
),
entry_b
->
filename
,
entry_b
->
filename_len
,
entry_is_tree
(
entry_b
));
}
...
...
@@ -717,7 +715,7 @@ static int tree_walk_post(
if
(
callback
(
path
->
ptr
,
entry
,
payload
)
<
0
)
continue
;
if
(
ENTRY_IS_TREE
(
entry
))
{
if
(
entry_is_tree
(
entry
))
{
git_tree
*
subtree
;
size_t
path_len
=
path
->
size
;
...
...
@@ -980,7 +978,7 @@ static int diff_index_cb(const char *root, git_tree_entry *tentry, void *data)
git_buf
fn_buf
=
GIT_BUF_INIT
;
int
cmp
,
error
=
GIT_SUCCESS
;
if
(
ENTRY_IS_TREE
(
tentry
))
if
(
entry_is_tree
(
tentry
))
return
GIT_SUCCESS
;
git_buf_puts
(
&
fn_buf
,
root
);
...
...
src/tree.h
View file @
a26a1563
...
...
@@ -31,6 +31,11 @@ struct git_treebuilder {
};
GIT_INLINE
(
unsigned
int
)
entry_is_tree
(
const
struct
git_tree_entry
*
e
)
{
return
e
->
attr
&
040000
;
}
void
git_tree__free
(
git_tree
*
tree
);
int
git_tree__parse
(
git_tree
*
tree
,
git_odb_object
*
obj
);
...
...
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