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
f6dbf9c5
Commit
f6dbf9c5
authored
Dec 03, 2022
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: helpers for getting ints from configuration
parent
366973f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
tests/clar/clar_libgit2.c
+19
-0
tests/clar/clar_libgit2.h
+3
-0
No files found.
tests/clar/clar_libgit2.c
View file @
f6dbf9c5
...
...
@@ -476,6 +476,25 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg)
return
val
;
}
void
cl_repo_set_int
(
git_repository
*
repo
,
const
char
*
cfg
,
int
value
)
{
git_config
*
config
;
cl_git_pass
(
git_repository_config
(
&
config
,
repo
));
cl_git_pass
(
git_config_set_int32
(
config
,
cfg
,
value
));
git_config_free
(
config
);
}
int
cl_repo_get_int
(
git_repository
*
repo
,
const
char
*
cfg
)
{
int
val
=
0
;
git_config
*
config
;
cl_git_pass
(
git_repository_config
(
&
config
,
repo
));
if
(
git_config_get_int32
(
&
val
,
config
,
cfg
)
<
0
)
git_error_clear
();
git_config_free
(
config
);
return
val
;
}
void
cl_repo_set_string
(
git_repository
*
repo
,
const
char
*
cfg
,
const
char
*
value
)
{
git_config
*
config
;
...
...
tests/clar/clar_libgit2.h
View file @
f6dbf9c5
...
...
@@ -231,6 +231,9 @@ void cl_repo_commit_from_index(
void
cl_repo_set_bool
(
git_repository
*
repo
,
const
char
*
cfg
,
int
value
);
int
cl_repo_get_bool
(
git_repository
*
repo
,
const
char
*
cfg
);
void
cl_repo_set_int
(
git_repository
*
repo
,
const
char
*
cfg
,
int
value
);
int
cl_repo_get_int
(
git_repository
*
repo
,
const
char
*
cfg
);
void
cl_repo_set_string
(
git_repository
*
repo
,
const
char
*
cfg
,
const
char
*
value
);
/* set up a fake "home" directory and set libgit2 GLOBAL search path.
...
...
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