Commit 78d65f39 by Carlos Martín Nieto

tests: add multivar read test

parent 0774d94d
#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);
}
[remote "fancy"]
fetch = git://github.com/libgit2/libgit2
fetch = git://git.example.com/libgit2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment