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
aed794d0
Commit
aed794d0
authored
Jul 09, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkout: only walk tree once while checking out.
parent
f2d42eea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
src/checkout.c
+5
-15
No files found.
src/checkout.c
View file @
aed794d0
...
...
@@ -53,15 +53,6 @@ typedef struct tree_walk_data
}
tree_walk_data
;
/* TODO: murder this */
static
int
count_walker
(
const
char
*
path
,
git_tree_entry
*
entry
,
void
*
payload
)
{
GIT_UNUSED
(
path
);
GIT_UNUSED
(
entry
);
((
tree_walk_data
*
)
payload
)
->
stats
->
total
++
;
return
0
;
}
static
int
apply_filters
(
git_buf
*
out
,
git_vector
*
filters
,
const
void
*
data
,
...
...
@@ -166,13 +157,12 @@ int git_checkout_force(git_repository *repo, git_indexer_stats *stats)
payload
.
stats
=
stats
;
payload
.
repo
=
repo
;
/* TODO: stats->total is never calculated. */
if
(
!
get_head_tree
(
&
tree
,
repo
))
{
/* Count all the tree nodes for progress information */
if
(
!
git_tree_walk
(
tree
,
count_walker
,
GIT_TREEWALK_POST
,
&
payload
))
{
/* Checkout the files */
if
(
!
git_tree_walk
(
tree
,
checkout_walker
,
GIT_TREEWALK_POST
,
&
payload
))
{
retcode
=
0
;
}
/* Checkout the files */
if
(
!
git_tree_walk
(
tree
,
checkout_walker
,
GIT_TREEWALK_POST
,
&
payload
))
{
retcode
=
0
;
}
git_tree_free
(
tree
);
}
...
...
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