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
b3408e3e
Commit
b3408e3e
authored
Feb 05, 2012
by
schu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
treebuilder: remove needless variable entry_count
Signed-off-by: schu <schu-github@schulog.org>
parent
f25cc58d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
9 deletions
+1
-9
src/tree.c
+1
-8
src/tree.h
+0
-1
No files found.
src/tree.c
View file @
b3408e3e
...
...
@@ -287,8 +287,6 @@ static int append_entry(git_treebuilder *bld, const char *filename, const git_oi
entry
->
filename
=
git__strdup
(
filename
);
entry
->
filename_len
=
strlen
(
entry
->
filename
);
bld
->
entry_count
++
;
git_oid_cpy
(
&
entry
->
oid
,
id
);
entry
->
attr
=
attributes
;
...
...
@@ -486,10 +484,8 @@ int git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, con
if
(
pos
>=
0
)
{
entry
=
git_vector_get
(
&
bld
->
entries
,
pos
);
if
(
entry
->
removed
)
{
if
(
entry
->
removed
)
entry
->
removed
=
0
;
bld
->
entry_count
++
;
}
}
else
{
if
((
entry
=
git__malloc
(
sizeof
(
git_tree_entry
)))
==
NULL
)
return
GIT_ENOMEM
;
...
...
@@ -497,8 +493,6 @@ int git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, con
memset
(
entry
,
0x0
,
sizeof
(
git_tree_entry
));
entry
->
filename
=
git__strdup
(
filename
);
entry
->
filename_len
=
strlen
(
entry
->
filename
);
bld
->
entry_count
++
;
}
git_oid_cpy
(
&
entry
->
oid
,
id
);
...
...
@@ -546,7 +540,6 @@ int git_treebuilder_remove(git_treebuilder *bld, const char *filename)
return
git__throw
(
GIT_ENOTFOUND
,
"Failed to remove entry. File isn't in the tree"
);
remove_ptr
->
removed
=
1
;
bld
->
entry_count
--
;
return
GIT_SUCCESS
;
}
...
...
src/tree.h
View file @
b3408e3e
...
...
@@ -27,7 +27,6 @@ struct git_tree {
struct
git_treebuilder
{
git_vector
entries
;
size_t
entry_count
;
};
...
...
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