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
78d65f39
Commit
78d65f39
authored
Feb 01, 2012
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add multivar read test
parent
0774d94d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
tests-clar/config/multivar.c
+24
-0
tests/resources/config/config11
+3
-0
No files found.
tests-clar/config/multivar.c
0 → 100644
View file @
78d65f39
#include "clar_libgit2.h"
static
int
mv_read_cb
(
const
char
*
name
,
const
char
*
GIT_UNUSED
(
value
),
void
*
data
)
{
int
*
n
=
(
int
*
)
data
;
if
(
!
strcmp
(
name
,
"remote.fancy.fetch"
))
(
*
n
)
++
;
return
0
;
}
void
test_config_multivar__foreach
(
void
)
{
git_config
*
cfg
;
int
n
=
0
;
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
cl_fixture
(
"config/config11"
)));
cl_git_pass
(
git_config_foreach
(
cfg
,
mv_read_cb
,
&
n
));
cl_assert
(
n
==
2
);
git_config_free
(
cfg
);
}
tests/resources/config/config11
0 → 100644
View file @
78d65f39
[remote "fancy"]
fetch = git://github.com/libgit2/libgit2
fetch = git://git.example.com/libgit2
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