diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2023-02-14 17:01:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 17:01:23 +0000 |
commit | 80742e159c3221fd853d9a0fe735b382a7e3419d (patch) | |
tree | 60514c97fde6a8630a174d3b61781347913b4f70 /tests/clar | |
parent | f7963f28cad7b2416a3cb0e55bc5adf85c82607b (diff) | |
parent | e3cd859150f720914dfbbdd2d80d12b1482a397a (diff) | |
download | libgit2-80742e159c3221fd853d9a0fe735b382a7e3419d.tar.gz |
Merge pull request #6456 from libgit2/ethomson/sha256_experimental
SHA256: more SHA256 support
Diffstat (limited to 'tests/clar')
-rw-r--r-- | tests/clar/clar_libgit2.c | 19 | ||||
-rw-r--r-- | tests/clar/clar_libgit2.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/clar/clar_libgit2.c b/tests/clar/clar_libgit2.c index 312e12103..54122997d 100644 --- a/tests/clar/clar_libgit2.c +++ b/tests/clar/clar_libgit2.c @@ -477,6 +477,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; diff --git a/tests/clar/clar_libgit2.h b/tests/clar/clar_libgit2.h index 84405d21c..c33b5d28b 100644 --- a/tests/clar/clar_libgit2.h +++ b/tests/clar/clar_libgit2.h @@ -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); /* |