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
43521d06
Commit
43521d06
authored
Jun 16, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: Rename git_referece_listcb to _foreach
Same name as `git_config_foreach`
parent
607d1643
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
include/git2/refs.h
+3
-4
src/refs.c
+3
-3
src/tag.c
+1
-1
No files found.
include/git2/refs.h
View file @
43521d06
...
...
@@ -299,10 +299,9 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo,
/**
* List all the references in the repository, calling a custom
* callback for each one.
* Perform an operation on each reference in the repository
*
* The
list
ed references may be filtered by type, or using
* The
process
ed references may be filtered by type, or using
* a bitwise OR of several types. Use the magic value
* `GIT_REF_LISTALL` to obtain all references, including
* packed ones.
...
...
@@ -318,7 +317,7 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo,
* @param payload Additional data to pass to the callback
* @return 0 on success; error code otherwise
*/
GIT_EXTERN
(
int
)
git_reference_
listcb
(
git_repository
*
repo
,
unsigned
int
list_flags
,
int
(
*
callback
)(
const
char
*
,
void
*
),
void
*
payload
);
GIT_EXTERN
(
int
)
git_reference_
foreach
(
git_repository
*
repo
,
unsigned
int
list_flags
,
int
(
*
callback
)(
const
char
*
,
void
*
),
void
*
payload
);
/** @} */
GIT_END_DECL
...
...
src/refs.c
View file @
43521d06
...
...
@@ -1086,7 +1086,7 @@ static int reference_available(git_repository *repo, const char *ref, const char
git_vector_insert
(
&
refs
,
(
void
*
)
ref
);
git_vector_insert
(
&
refs
,
(
void
*
)
old_ref
);
error
=
git_reference_
listcb
(
repo
,
GIT_REF_LISTALL
,
_reference_available_cb
,
(
void
*
)
&
refs
);
error
=
git_reference_
foreach
(
repo
,
GIT_REF_LISTALL
,
_reference_available_cb
,
(
void
*
)
&
refs
);
git_vector_free
(
&
refs
);
...
...
@@ -1573,7 +1573,7 @@ int git_reference_packall(git_repository *repo)
return
packed_write
(
repo
);
}
int
git_reference_
listcb
(
git_repository
*
repo
,
unsigned
int
list_flags
,
int
(
*
callback
)(
const
char
*
,
void
*
),
void
*
payload
)
int
git_reference_
foreach
(
git_repository
*
repo
,
unsigned
int
list_flags
,
int
(
*
callback
)(
const
char
*
,
void
*
),
void
*
payload
)
{
int
error
;
struct
dirent_list_data
data
;
...
...
@@ -1625,7 +1625,7 @@ int git_reference_listall(git_strarray *array, git_repository *repo, unsigned in
if
(
git_vector_init
(
&
ref_list
,
8
,
NULL
)
<
GIT_SUCCESS
)
return
GIT_ENOMEM
;
error
=
git_reference_
listcb
(
repo
,
list_flags
,
&
cb__reflist_add
,
(
void
*
)
&
ref_list
);
error
=
git_reference_
foreach
(
repo
,
list_flags
,
&
cb__reflist_add
,
(
void
*
)
&
ref_list
);
if
(
error
<
GIT_SUCCESS
)
{
git_vector_free
(
&
ref_list
);
...
...
src/tag.c
View file @
43521d06
...
...
@@ -450,7 +450,7 @@ int git_tag_list(git_strarray *tag_names, git_repository *repo)
if
(
git_vector_init
(
&
taglist
,
8
,
NULL
)
<
GIT_SUCCESS
)
return
GIT_ENOMEM
;
error
=
git_reference_
listcb
(
repo
,
GIT_REF_OID
|
GIT_REF_PACKED
,
&
tag_list_cb
,
(
void
*
)
&
taglist
);
error
=
git_reference_
foreach
(
repo
,
GIT_REF_OID
|
GIT_REF_PACKED
,
&
tag_list_cb
,
(
void
*
)
&
taglist
);
if
(
error
<
GIT_SUCCESS
)
{
git_vector_free
(
&
taglist
);
return
git__rethrow
(
error
,
"Failed to list tags"
);
...
...
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