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
48ebea66
Commit
48ebea66
authored
Jan 07, 2013
by
nulltoken
Committed by
Carlos Martín Nieto
Apr 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Introduce count_config_entries_match() helper
parent
892778ee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
tests/config/config_helpers.c
+28
-0
tests/config/config_helpers.h
+4
-0
No files found.
tests/config/config_helpers.c
View file @
48ebea66
...
...
@@ -35,3 +35,31 @@ void assert_config_entry_value(
cl_assert_equal_s
(
expected_value
,
out
);
}
static
int
count_config_entries_cb
(
const
git_config_entry
*
entry
,
void
*
payload
)
{
int
*
how_many
=
(
int
*
)
payload
;
GIT_UNUSED
(
entry
);
(
*
how_many
)
++
;
return
0
;
}
int
count_config_entries_match
(
git_repository
*
repo
,
const
char
*
pattern
)
{
git_config
*
config
;
int
how_many
=
0
;
cl_git_pass
(
git_repository_config
(
&
config
,
repo
));
cl_assert_equal_i
(
0
,
git_config_foreach_match
(
config
,
pattern
,
count_config_entries_cb
,
&
how_many
));
git_config_free
(
config
);
return
how_many
;
}
tests/config/config_helpers.h
View file @
48ebea66
...
...
@@ -7,3 +7,7 @@ extern void assert_config_entry_value(
git_repository
*
repo
,
const
char
*
name
,
const
char
*
expected_value
);
extern
int
count_config_entries_match
(
git_repository
*
repo
,
const
char
*
pattern
);
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