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
95727245
Commit
95727245
authored
May 04, 2013
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: implement _foreach with the iterator
parent
932af0e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
src/refs.c
+21
-3
No files found.
src/refs.c
View file @
95727245
...
@@ -562,10 +562,28 @@ int git_reference_foreach(
...
@@ -562,10 +562,28 @@ int git_reference_foreach(
git_reference_foreach_cb
callback
,
git_reference_foreach_cb
callback
,
void
*
payload
)
void
*
payload
)
{
{
git_refdb
*
refdb
;
git_reference_iterator
*
iter
;
git_repository_refdb__weakptr
(
&
refdb
,
repo
);
const
char
*
name
;
int
error
;
GIT_UNUSED
(
list_flags
);
if
(
git_reference_iterator_new
(
&
iter
,
repo
)
<
0
)
return
-
1
;
return
git_refdb_foreach
(
refdb
,
list_flags
,
callback
,
payload
);
while
((
error
=
git_reference_next
(
&
name
,
iter
))
==
0
)
{
if
(
callback
(
name
,
payload
))
{
error
=
GIT_EUSER
;
goto
out
;
}
}
if
(
error
==
GIT_ITEROVER
)
error
=
0
;
out:
git_reference_iterator_free
(
iter
);
return
error
;
}
}
int
git_reference_iterator_new
(
git_reference_iterator
**
out
,
git_repository
*
repo
)
int
git_reference_iterator_new
(
git_reference_iterator
**
out
,
git_repository
*
repo
)
...
...
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