Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-09-07 17:13:11 +0400
committernulltoken <emeric.fermas@gmail.com>2012-10-25 19:42:31 +0400
commit0b98a8a4246c9a7825df6c90a1553e799d68146d (patch)
treea4597d2f9ef561a4f43d317f35971f0807c176f5 /tests-clar/config
parent5edb846e03961cac06d1aab4cb5e2329936837f1 (diff)
branch: remove config section upon deletion
Diffstat (limited to 'tests-clar/config')
-rw-r--r--tests-clar/config/config_helpers.c22
-rw-r--r--tests-clar/config/config_helpers.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/tests-clar/config/config_helpers.c b/tests-clar/config/config_helpers.c
new file mode 100644
index 000000000..652f80f94
--- /dev/null
+++ b/tests-clar/config/config_helpers.c
@@ -0,0 +1,22 @@
+#include "clar_libgit2.h"
+#include "config_helpers.h"
+#include "repository.h"
+
+void assert_config_entry_existence(
+ git_repository *repo,
+ const char *name,
+ bool is_supposed_to_exist)
+{
+ git_config *config;
+ const char *out;
+ int result;
+
+ cl_git_pass(git_repository_config__weakptr(&config, repo));
+
+ result = git_config_get_string(&out, config, name);
+
+ if (is_supposed_to_exist)
+ cl_git_pass(result);
+ else
+ cl_assert_equal_i(GIT_ENOTFOUND, result);
+}
diff --git a/tests-clar/config/config_helpers.h b/tests-clar/config/config_helpers.h
new file mode 100644
index 000000000..d18c6c33d
--- /dev/null
+++ b/tests-clar/config/config_helpers.h
@@ -0,0 +1,4 @@
+extern void assert_config_entry_existence(
+ git_repository *repo,
+ const char *name,
+ bool is_supposed_to_exist);