summaryrefslogtreecommitdiff
path: root/tests/repo/shallow.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/repo/shallow.c')
-rw-r--r--tests/repo/shallow.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/repo/shallow.c b/tests/repo/shallow.c
new file mode 100644
index 000000000..1cc66ae40
--- /dev/null
+++ b/tests/repo/shallow.c
@@ -0,0 +1,33 @@
+#include "clar_libgit2.h"
+#include "fileops.h"
+
+static git_repository *g_repo;
+
+void test_repo_shallow__initialize(void)
+{
+}
+
+void test_repo_shallow__cleanup(void)
+{
+ cl_git_sandbox_cleanup();
+}
+
+void test_repo_shallow__no_shallow_file(void)
+{
+ g_repo = cl_git_sandbox_init("testrepo.git");
+ cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
+}
+
+void test_repo_shallow__empty_shallow_file(void)
+{
+ g_repo = cl_git_sandbox_init("testrepo.git");
+ cl_git_mkfile("testrepo.git/shallow", "");
+ cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
+}
+
+void test_repo_shallow__shallow_repo(void)
+{
+ g_repo = cl_git_sandbox_init("shallow.git");
+ cl_assert_equal_i(1, git_repository_is_shallow(g_repo));
+}
+