summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-03-05 15:09:01 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-23 00:25:05 +0200
commita8375f532204f4c0c70a3f937b47000b61669725 (patch)
tree580814203673a41f73ddd3120d31eec42d7d8d9f
parent2ce44b67f3398ff3c1bfdfd60a99f72bd0c42e90 (diff)
downloadlibgit2-a8375f532204f4c0c70a3f937b47000b61669725.tar.gz
Add test exercising the opening of an standard repository initialized by git
-rw-r--r--tests/t12-repo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/t12-repo.c b/tests/t12-repo.c
index b81b598fb..adf20cfd7 100644
--- a/tests/t12-repo.c
+++ b/tests/t12-repo.c
@@ -199,6 +199,24 @@ BEGIN_TEST(open0, "Open a bare repository that has just been initialized by git"
must_pass(rmdir_recurs(TEMP_REPO_FOLDER));
END_TEST
+#define SOURCE_EMPTY_REPOSITORY_NAME "empty_standard_repo/.gitted"
+#define EMPTY_REPOSITORY_NAME "empty_standard_repo/.git"
+#define EMPTY_REPOSITORY_FOLDER TEST_RESOURCES "/" SOURCE_EMPTY_REPOSITORY_NAME "/"
+#define DEST_REPOSITORY_FOLDER TEMP_REPO_FOLDER DOT_GIT "/"
+
+BEGIN_TEST(open1, "Open a standard repository that has just been initialized by git")
+ git_repository *repo;
+
+ must_pass(copydir_recurs(EMPTY_REPOSITORY_FOLDER, DEST_REPOSITORY_FOLDER));
+ must_pass(remove_placeholders(DEST_REPOSITORY_FOLDER, "dummy-marker.txt"));
+
+ must_pass(git_repository_open(&repo, DEST_REPOSITORY_FOLDER));
+
+ git_repository_free(repo);
+ must_pass(rmdir_recurs(TEMP_REPO_FOLDER));
+END_TEST
+
+
BEGIN_TEST(open2, "Open a bare repository with a relative path escaping out of the current working directory")
char new_current_workdir[GIT_PATH_MAX];
char current_workdir[GIT_PATH_MAX];
@@ -233,6 +251,7 @@ BEGIN_SUITE(repository)
ADD_TEST(init1);
ADD_TEST(init2);
ADD_TEST(open0);
+ ADD_TEST(open1);
ADD_TEST(open2);
END_SUITE