diff --git a/CMakeLists.txt b/CMakeLists.txt index 383627bb9..eaf58ab3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,11 +147,14 @@ IF (BUILD_TESTS) ENDIF () IF (BUILD_CLAR) + FIND_PACKAGE(PythonInterp REQUIRED) SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/tests/resources/") SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tests-clar") + SET(CLAR_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tests-clar/resources" CACHE PATH "Path to test resources.") ADD_DEFINITIONS(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\") + ADD_DEFINITIONS(-DCLAR_RESOURCES=\"${TEST_RESOURCES}\") INCLUDE_DIRECTORIES(${CLAR_PATH}) FILE(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/clar_helpers.c ${CLAR_PATH}/testlib.c) diff --git a/tests-clar/commit/parse.c b/tests-clar/commit/parse.c new file mode 100644 index 000000000..bbb502cb5 --- /dev/null +++ b/tests-clar/commit/parse.c @@ -0,0 +1,350 @@ +#include "clar_libgit2.h" +#include +#include "commit.h" +#include "signature.h" + +// Fixture setup +static git_repository *g_repo; +void test_commit_parse__initialize(void) +{ + g_repo = cl_git_sandbox_init("testrepo"); +} +void test_commit_parse__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + + +// Header parsing +typedef struct { + const char *line; + const char *header; +} parse_test_case; + +static parse_test_case passing_header_cases[] = { + { "parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "parent " }, + { "tree 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree " }, + { "random_heading 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "random_heading " }, + { "stuck_heading05452d6349abcd67aa396dfb28660d765d8b2a36\n", "stuck_heading" }, + { "tree 5F4BEFFC0759261D015AA63A3A85613FF2F235DE\n", "tree " }, + { "tree 1A669B8AB81B5EB7D9DB69562D34952A38A9B504\n", "tree " }, + { "tree 5B20DCC6110FCC75D31C6CEDEBD7F43ECA65B503\n", "tree " }, + { "tree 173E7BF00EA5C33447E99E6C1255954A13026BE4\n", "tree " }, + { NULL, NULL } +}; + +static parse_test_case failing_header_cases[] = { + { "parent 05452d6349abcd67aa396dfb28660d765d8b2a36", "parent " }, + { "05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree " }, + { "parent05452d6349abcd67aa396dfb28660d765d8b2a6a\n", "parent " }, + { "parent 05452d6349abcd67aa396dfb280d765d8b2a6\n", "parent " }, + { "tree 05452d6349abcd67aa396dfb28660d765d8b2a36\n", "tree " }, + { "parent 0545xd6349abcd67aa396dfb28660d765d8b2a36\n", "parent " }, + { "parent 0545xd6349abcd67aa396dfb28660d765d8b2a36FF\n", "parent " }, + { "", "tree " }, + { "", "" }, + { NULL, NULL } +}; + +void test_commit_parse__header(void) +{ + git_oid oid; + + parse_test_case *testcase; + for (testcase = passing_header_cases; testcase->line != NULL; testcase++) + { + const char *line = testcase->line; + const char *line_end = line + strlen(line); + + cl_git_pass(git_oid__parse(&oid, &line, line_end, testcase->header)); + cl_assert(line == line_end); + } + + for (testcase = failing_header_cases; testcase->line != NULL; testcase++) + { + const char *line = testcase->line; + const char *line_end = line + strlen(line); + + cl_git_fail(git_oid__parse(&oid, &line, line_end, testcase->header)); + } +} + + +// Signature parsing +typedef struct { + const char *string; + const char *header; + const char *name; + const char *email; + git_time_t time; + int offset; +} passing_signature_test_case; + +passing_signature_test_case passing_signature_cases[] = { + {"author Vicent Marti 12345 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 12345, 0}, + {"author Vicent Marti <> 12345 \n", "author ", "Vicent Marti", "", 12345, 0}, + {"author Vicent Marti 231301 +1020\n", "author ", "Vicent Marti", "tanoku@gmail.com", 231301, 620}, + {"author Vicent Marti with an outrageously long name which will probably overflow the buffer 12345 \n", "author ", "Vicent Marti with an outrageously long name which will probably overflow the buffer", "tanoku@gmail.com", 12345, 0}, + {"author Vicent Marti 12345 \n", "author ", "Vicent Marti", "tanokuwithaveryveryverylongemailwhichwillprobablyvoverflowtheemailbuffer@gmail.com", 12345, 0}, + {"committer Vicent Marti 123456 +0000 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0}, + {"committer Vicent Marti 123456 +0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 60}, + {"committer Vicent Marti 123456 -0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, -60}, + // Parse a signature without an author field + {"committer 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, + // Parse a signature without an author field + {"committer 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, + // Parse a signature with an empty author field + {"committer 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60}, + // Parse a signature with an empty email field + {"committer Vicent Marti <> 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60}, + // Parse a signature with an empty email field + {"committer Vicent Marti < > 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60}, + // Parse a signature with empty name and email + {"committer <> 123456 -0100 \n", "committer ", "", "", 123456, -60}, + // Parse a signature with empty name and email + {"committer <> 123456 -0100 \n", "committer ", "", "", 123456, -60}, + // Parse a signature with empty name and email + {"committer < > 123456 -0100 \n", "committer ", "", "", 123456, -60}, + // Parse an obviously invalid signature + {"committer foo<@bar> 123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60}, + // Parse an obviously invalid signature + {"committer foo<@bar>123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60}, + // Parse an obviously invalid signature + {"committer <>\n", "committer ", "", "", 0, 0}, + {"committer Vicent Marti 123456 -1500 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"committer Vicent Marti 123456 +0163 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"author Vicent Marti notime \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"author Vicent Marti 123456 notimezone \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"author Vicent Marti notime +0100\n", "author ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"author Vicent Marti \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0, 0}, + {"author A U Thor , C O. Miter 1234567890 -0700\n", "author ", "A U Thor", "author@example.com", 1234567890, -420}, + {"author A U Thor and others 1234567890 -0700\n", "author ", "A U Thor", "author@example.com", 1234567890, -420}, + {"author A U Thor and others 1234567890\n", "author ", "A U Thor", "author@example.com", 1234567890, 0}, + {"author A U Thor> and others 1234567890\n", "author ", "A U Thor>", "author@example.com", 1234567890, 0}, + {NULL,NULL,NULL,NULL,0,0} +}; + +typedef struct { + const char *string; + const char *header; +} failing_signature_test_case; + +failing_signature_test_case failing_signature_cases[] = { + {"committer Vicent Marti tanoku@gmail.com> 123456 -0100 \n", "committer "}, + {"author Vicent Marti 12345 \n", "author "}, + {"author Vicent Marti 12345 \n", "committer "}, + {"author Vicent Marti 12345 \n", "author "}, + {"author Vicent Marti <\n", "committer "}, + {"author ", "author "}, + {NULL,NULL,} +}; + +void test_commit_parse__signature(void) +{ + passing_signature_test_case *passcase; + failing_signature_test_case *failcase; + + for (passcase = passing_signature_cases; passcase->string != NULL; passcase++) + { + const char *str = passcase->string; + size_t len = strlen(passcase->string); + struct git_signature person = {NULL, NULL, {0, 0}}; + cl_git_pass(git_signature__parse(&person, &str, str + len, passcase->header, '\n')); + cl_assert(strcmp(passcase->name, person.name) == 0); + cl_assert(strcmp(passcase->email, person.email) == 0); + cl_assert(passcase->time == person.when.time); + cl_assert(passcase->offset == person.when.offset); + git__free(person.name); git__free(person.email); + } + + for (failcase = failing_signature_cases; failcase->string != NULL; failcase++) + { + const char *str = failcase->string; + size_t len = strlen(failcase->string); + git_signature person = {NULL, NULL, {0, 0}}; + cl_git_fail(git_signature__parse(&person, &str, str + len, failcase->header, '\n')); + git__free(person.name); git__free(person.email); + } +} + + + +static char *failing_commit_cases[] = { +// empty commit +"", +// random garbage +"asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n", +// broken endlines 1 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\ +parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\ +author Vicent Marti 1273848544 +0200\r\n\ +committer Vicent Marti 1273848544 +0200\r\n\ +\r\n\ +a test commit with broken endlines\r\n", +// broken endlines 2 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\ +parent 05452d6349abcd67aa396dfb28660d765d8b2a36\ +author Vicent Marti 1273848544 +0200\ +committer Vicent Marti 1273848544 +0200\ +\ +another test commit with broken endlines", +// starting endlines +"\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ +parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\ +author Vicent Marti 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n\ +a test commit with a starting endline\n", +// corrupted commit 1 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ +parent 05452d6349abcd67aa396df", +// corrupted commit 2 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ +parent ", +// corrupted commit 3 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ +parent ", +// corrupted commit 4 +"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ +par", +}; + + +static char *passing_commit_cases[] = { +// simple commit with no message +"tree 1810dff58d8a660512d4832e740f692884338ccd\n\ +author Vicent Marti 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n", +// simple commit, no parent +"tree 1810dff58d8a660512d4832e740f692884338ccd\n\ +author Vicent Marti 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n\ +a simple commit which works\n", +// simple commit, no parent, no newline in message +"tree 1810dff58d8a660512d4832e740f692884338ccd\n\ +author Vicent Marti 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n\ +a simple commit which works", +// simple commit, 1 parent +"tree 1810dff58d8a660512d4832e740f692884338ccd\n\ +parent e90810b8df3e80c413d903f631643c716887138d\n\ +author Vicent Marti 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n\ +a simple commit which works\n", +}; + +void test_commit_parse__entire_commit(void) +{ + const int broken_commit_count = sizeof(failing_commit_cases) / sizeof(*failing_commit_cases); + const int working_commit_count = sizeof(passing_commit_cases) / sizeof(*passing_commit_cases); + int i; + + for (i = 0; i < broken_commit_count; ++i) { + git_commit *commit; + commit = (git_commit*)git__malloc(sizeof(git_commit)); + memset(commit, 0x0, sizeof(git_commit)); + commit->object.repo = g_repo; + + cl_git_fail(git_commit__parse_buffer( + commit, + failing_commit_cases[i], + strlen(failing_commit_cases[i])) + ); + + git_commit__free(commit); + } + + for (i = 0; i < working_commit_count; ++i) { + git_commit *commit; + + commit = (git_commit*)git__malloc(sizeof(git_commit)); + memset(commit, 0x0, sizeof(git_commit)); + commit->object.repo = g_repo; + + cl_git_pass(git_commit__parse_buffer( + commit, + passing_commit_cases[i], + strlen(passing_commit_cases[i])) + ); + + git_commit__free(commit); + + commit = (git_commit*)git__malloc(sizeof(git_commit)); + memset(commit, 0x0, sizeof(git_commit)); + commit->object.repo = g_repo; + + cl_git_pass(git_commit__parse_buffer( + commit, + passing_commit_cases[i], + strlen(passing_commit_cases[i])) + ); + + git_commit__free(commit); + } +} + + +// query the details on a parsed commit +void test_commit_parse__details0(void) { + static const char *commit_ids[] = { + "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */ + "9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */ + "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */ + "c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */ + "8496071c1b46c854b31185ea97743be6a8774479", /* 4 */ + "5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */ + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", /* 6 */ + }; + const size_t commit_count = sizeof(commit_ids) / sizeof(const char *); + unsigned int i; + + for (i = 0; i < commit_count; ++i) { + git_oid id; + git_commit *commit; + + const git_signature *author, *committer; + const char *message; + git_time_t commit_time; + unsigned int parents, p; + git_commit *parent = NULL, *old_parent = NULL; + + git_oid_fromstr(&id, commit_ids[i]); + + cl_git_pass(git_commit_lookup(&commit, g_repo, &id)); + + message = git_commit_message(commit); + author = git_commit_author(commit); + committer = git_commit_committer(commit); + commit_time = git_commit_time(commit); + parents = git_commit_parentcount(commit); + + cl_assert(strcmp(author->name, "Scott Chacon") == 0); + cl_assert(strcmp(author->email, "schacon@gmail.com") == 0); + cl_assert(strcmp(committer->name, "Scott Chacon") == 0); + cl_assert(strcmp(committer->email, "schacon@gmail.com") == 0); + cl_assert(message != NULL); + cl_assert(strchr(message, '\n') != NULL); + cl_assert(commit_time > 0); + cl_assert(parents <= 2); + for (p = 0;p < parents;p++) { + if (old_parent != NULL) + git_commit_free(old_parent); + + old_parent = parent; + cl_git_pass(git_commit_parent(&parent, commit, p)); + cl_assert(parent != NULL); + cl_assert(git_commit_author(parent) != NULL); // is it really a commit? + } + git_commit_free(old_parent); + git_commit_free(parent); + + cl_git_fail(git_commit_parent(&parent, commit, parents)); + git_commit_free(commit); + } +} + diff --git a/tests-clar/commit/signature.c b/tests-clar/commit/signature.c new file mode 100644 index 000000000..605b8330a --- /dev/null +++ b/tests-clar/commit/signature.c @@ -0,0 +1,65 @@ +#include "clar_libgit2.h" + +static int try_build_signature(const char *name, const char *email, git_time_t time, int offset) +{ + git_signature *sign; + int error = GIT_SUCCESS; + + if ((error = git_signature_new(&sign, name, email, time, offset)) < GIT_SUCCESS) + return error; + + git_signature_free((git_signature *)sign); + + return error; +} + + +void test_commit_signature__create_trim(void) +{ + // creating a signature trims leading and trailing spaces + git_signature *sign; + cl_git_pass(git_signature_new(&sign, " nulltoken ", " emeric.fermas@gmail.com ", 1234567890, 60)); + cl_assert(strcmp(sign->name, "nulltoken") == 0); + cl_assert(strcmp(sign->email, "emeric.fermas@gmail.com") == 0); + git_signature_free((git_signature *)sign); +} + + +void test_commit_signature__create_empties(void) +{ + // can not create a signature with empty name or email + cl_git_pass(try_build_signature("nulltoken", "emeric.fermas@gmail.com", 1234567890, 60)); + + cl_git_fail(try_build_signature("", "emeric.fermas@gmail.com", 1234567890, 60)); + cl_git_fail(try_build_signature(" ", "emeric.fermas@gmail.com", 1234567890, 60)); + cl_git_fail(try_build_signature("nulltoken", "", 1234567890, 60)); + cl_git_fail(try_build_signature("nulltoken", " ", 1234567890, 60)); +} + +void test_commit_signature__create_one_char(void) +{ + // creating a one character signature + git_signature *sign; + cl_git_pass(git_signature_new(&sign, "x", "foo@bar.baz", 1234567890, 60)); + cl_assert(strcmp(sign->name, "x") == 0); + cl_assert(strcmp(sign->email, "foo@bar.baz") == 0); + git_signature_free((git_signature *)sign); +} + +void test_commit_signature__create_two_char(void) +{ + // creating a two character signature + git_signature *sign; + cl_git_pass(git_signature_new(&sign, "xx", "x@y.z", 1234567890, 60)); + cl_assert(strcmp(sign->name, "xx") == 0); + cl_assert(strcmp(sign->email, "x@y.z") == 0); + git_signature_free((git_signature *)sign); +} + +void test_commit_signature__create_zero_char(void) +{ + // creating a zero character signature + git_signature *sign; + cl_git_fail(git_signature_new(&sign, "", "x@y.z", 1234567890, 60)); + cl_assert(sign == NULL); +} diff --git a/tests-clar/commit/write.c b/tests-clar/commit/write.c new file mode 100644 index 000000000..66fe2bfcb --- /dev/null +++ b/tests-clar/commit/write.c @@ -0,0 +1,141 @@ +#include "clar_libgit2.h" + +static const char *committer_name = "Vicent Marti"; +static const char *committer_email = "vicent@github.com"; +static const char *commit_message = "This commit has been created in memory\n\ + This is a commit created in memory and it will be written back to disk\n"; +static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd"; +static const char *root_commit_message = "This is a root commit\n\ +This is a root commit and should be the only one in this branch\n"; + + +// Fixture setup +static git_repository *g_repo; +void test_commit_write__initialize(void) +{ + g_repo = cl_git_sandbox_init("testrepo"); +} +void test_commit_write__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + + +// write a new commit object from memory to disk +void test_commit_write__from_memory(void) +{ + git_commit *commit; + git_oid tree_id, parent_id, commit_id; + git_signature *author, *committer; + const git_signature *author1, *committer1; + git_commit *parent; + git_tree *tree; + const char *commit_id_str = "8496071c1b46c854b31185ea97743be6a8774479"; + + git_oid_fromstr(&tree_id, tree_oid); + cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); + + git_oid_fromstr(&parent_id, commit_id_str); + cl_git_pass(git_commit_lookup(&parent, g_repo, &parent_id)); + + /* create signatures */ + cl_git_pass(git_signature_new(&committer, committer_name, committer_email, 123456789, 60)); + cl_git_pass(git_signature_new(&author, committer_name, committer_email, 987654321, 90)); + + cl_git_pass(git_commit_create_v( + &commit_id, /* out id */ + g_repo, + NULL, /* do not update the HEAD */ + author, + committer, + NULL, + commit_message, + tree, + 1, parent)); + + git_object_free((git_object *)parent); + git_object_free((git_object *)tree); + + git_signature_free(committer); + git_signature_free(author); + + cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id)); + + /* Check attributes were set correctly */ + author1 = git_commit_author(commit); + cl_assert(author1 != NULL); + cl_assert(strcmp(author1->name, committer_name) == 0); + cl_assert(strcmp(author1->email, committer_email) == 0); + cl_assert(author1->when.time == 987654321); + cl_assert(author1->when.offset == 90); + + committer1 = git_commit_committer(commit); + cl_assert(committer1 != NULL); + cl_assert(strcmp(committer1->name, committer_name) == 0); + cl_assert(strcmp(committer1->email, committer_email) == 0); + cl_assert(committer1->when.time == 123456789); + cl_assert(committer1->when.offset == 60); + + cl_assert(strcmp(git_commit_message(commit), commit_message) == 0); + +#ifndef GIT_WIN32 + cl_assert((loose_object_mode(REPOSITORY_FOLDER, (git_object *)commit) & 0777) == GIT_OBJECT_FILE_MODE); +#endif +} + + + +// create a root commit +void test_commit_write__root(void) +{ + git_commit *commit; + git_oid tree_id, commit_id; + const git_oid *branch_oid; + git_signature *author, *committer; + const char *branch_name = "refs/heads/root-commit-branch"; + git_reference *head, *branch; + char *head_old; + git_tree *tree; + + git_oid_fromstr(&tree_id, tree_oid); + cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); + + /* create signatures */ + cl_git_pass(git_signature_new(&committer, committer_name, committer_email, 123456789, 60)); + cl_git_pass(git_signature_new(&author, committer_name, committer_email, 987654321, 90)); + + /* First we need to update HEAD so it points to our non-existant branch */ + cl_git_pass(git_reference_lookup(&head, g_repo, "HEAD")); + cl_assert(git_reference_type(head) == GIT_REF_SYMBOLIC); + head_old = git__strdup(git_reference_target(head)); + cl_assert(head_old != NULL); + + cl_git_pass(git_reference_set_target(head, branch_name)); + + cl_git_pass(git_commit_create_v( + &commit_id, /* out id */ + g_repo, + "HEAD", + author, + committer, + NULL, + root_commit_message, + tree, + 0)); + + git_object_free((git_object *)tree); + git_signature_free(committer); + git_signature_free(author); + + /* + * The fact that creating a commit works has already been + * tested. Here we just make sure it's our commit and that it was + * written as a root commit. + */ + cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id)); + cl_assert(git_commit_parentcount(commit) == 0); + cl_git_pass(git_reference_lookup(&branch, g_repo, branch_name)); + branch_oid = git_reference_oid(branch); + cl_git_pass(git_oid_cmp(branch_oid, &commit_id)); + cl_assert(!strcmp(git_commit_message(commit), root_commit_message)); +} diff --git a/tests/resources/testrepo/.gitted/HEAD b/tests/resources/testrepo/.gitted/HEAD new file mode 100644 index 000000000..cb089cd89 Binary files /dev/null and b/tests/resources/testrepo/.gitted/HEAD differ diff --git a/tests/resources/testrepo/.gitted/config b/tests/resources/testrepo/.gitted/config new file mode 100644 index 000000000..1a5aacdfa Binary files /dev/null and b/tests/resources/testrepo/.gitted/config differ diff --git a/tests/resources/testrepo/.gitted/head-tracker b/tests/resources/testrepo/.gitted/head-tracker new file mode 100644 index 000000000..40d876b4c Binary files /dev/null and b/tests/resources/testrepo/.gitted/head-tracker differ diff --git a/tests/resources/testrepo/.gitted/index b/tests/resources/testrepo/.gitted/index new file mode 100644 index 000000000..a27fb9c96 Binary files /dev/null and b/tests/resources/testrepo/.gitted/index differ diff --git a/tests/resources/testrepo/.gitted/objects/13/85f264afb75a56a5bec74243be9b367ba4ca08 b/tests/resources/testrepo/.gitted/objects/13/85f264afb75a56a5bec74243be9b367ba4ca08 new file mode 100644 index 000000000..cedb2a22e Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/13/85f264afb75a56a5bec74243be9b367ba4ca08 differ diff --git a/tests/resources/testrepo/.gitted/objects/18/1037049a54a1eb5fab404658a3a250b44335d7 b/tests/resources/testrepo/.gitted/objects/18/1037049a54a1eb5fab404658a3a250b44335d7 new file mode 100644 index 000000000..93a16f146 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/18/1037049a54a1eb5fab404658a3a250b44335d7 differ diff --git a/tests/resources/testrepo/.gitted/objects/18/10dff58d8a660512d4832e740f692884338ccd b/tests/resources/testrepo/.gitted/objects/18/10dff58d8a660512d4832e740f692884338ccd new file mode 100644 index 000000000..ba0bfb30c Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/18/10dff58d8a660512d4832e740f692884338ccd differ diff --git a/tests/resources/testrepo/.gitted/objects/1f/67fc4386b2d171e0d21be1c447e12660561f9b b/tests/resources/testrepo/.gitted/objects/1f/67fc4386b2d171e0d21be1c447e12660561f9b new file mode 100644 index 000000000..225c45734 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/1f/67fc4386b2d171e0d21be1c447e12660561f9b differ diff --git a/tests/resources/testrepo/.gitted/objects/27/0b8ea76056d5cad83af921837702d3e3c2924d b/tests/resources/testrepo/.gitted/objects/27/0b8ea76056d5cad83af921837702d3e3c2924d new file mode 100644 index 000000000..df40d99af Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/27/0b8ea76056d5cad83af921837702d3e3c2924d differ diff --git a/tests/resources/testrepo/.gitted/objects/32/59a6bd5b57fb9c1281bb7ed3167b50f224cb54 b/tests/resources/testrepo/.gitted/objects/32/59a6bd5b57fb9c1281bb7ed3167b50f224cb54 new file mode 100644 index 000000000..321eaa867 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/32/59a6bd5b57fb9c1281bb7ed3167b50f224cb54 differ diff --git a/tests/resources/testrepo/.gitted/objects/36/97d64be941a53d4ae8f6a271e4e3fa56b022cc b/tests/resources/testrepo/.gitted/objects/36/97d64be941a53d4ae8f6a271e4e3fa56b022cc new file mode 100644 index 000000000..9bb5b623b Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/36/97d64be941a53d4ae8f6a271e4e3fa56b022cc differ diff --git a/tests/resources/testrepo/.gitted/objects/45/b983be36b73c0788dc9cbcb76cbb80fc7bb057 b/tests/resources/testrepo/.gitted/objects/45/b983be36b73c0788dc9cbcb76cbb80fc7bb057 new file mode 100644 index 000000000..7ca4ceed5 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/45/b983be36b73c0788dc9cbcb76cbb80fc7bb057 differ diff --git a/tests/resources/testrepo/.gitted/objects/4a/202b346bb0fb0db7eff3cffeb3c70babbd2045 b/tests/resources/testrepo/.gitted/objects/4a/202b346bb0fb0db7eff3cffeb3c70babbd2045 new file mode 100644 index 000000000..8953b6cef Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/4a/202b346bb0fb0db7eff3cffeb3c70babbd2045 differ diff --git a/tests/resources/testrepo/.gitted/objects/5b/5b025afb0b4c913b4c338a42934a3863bf3644 b/tests/resources/testrepo/.gitted/objects/5b/5b025afb0b4c913b4c338a42934a3863bf3644 new file mode 100644 index 000000000..c1f22c54f Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/5b/5b025afb0b4c913b4c338a42934a3863bf3644 differ diff --git a/tests/resources/testrepo/.gitted/objects/75/057dd4114e74cca1d750d0aee1647c903cb60a b/tests/resources/testrepo/.gitted/objects/75/057dd4114e74cca1d750d0aee1647c903cb60a new file mode 100644 index 000000000..2ef4faa0f Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/75/057dd4114e74cca1d750d0aee1647c903cb60a differ diff --git a/tests/resources/testrepo/.gitted/objects/76/3d71aadf09a7951596c9746c024e7eece7c7af b/tests/resources/testrepo/.gitted/objects/76/3d71aadf09a7951596c9746c024e7eece7c7af new file mode 100644 index 000000000..716b0c64b Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/76/3d71aadf09a7951596c9746c024e7eece7c7af differ diff --git a/tests/resources/testrepo/.gitted/objects/7b/4384978d2493e851f9cca7858815fac9b10980 b/tests/resources/testrepo/.gitted/objects/7b/4384978d2493e851f9cca7858815fac9b10980 new file mode 100644 index 000000000..23c462f34 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/7b/4384978d2493e851f9cca7858815fac9b10980 differ diff --git a/tests/resources/testrepo/.gitted/objects/81/4889a078c031f61ed08ab5fa863aea9314344d b/tests/resources/testrepo/.gitted/objects/81/4889a078c031f61ed08ab5fa863aea9314344d new file mode 100644 index 000000000..2f9b6b6e3 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/81/4889a078c031f61ed08ab5fa863aea9314344d differ diff --git a/tests/resources/testrepo/.gitted/objects/84/96071c1b46c854b31185ea97743be6a8774479 b/tests/resources/testrepo/.gitted/objects/84/96071c1b46c854b31185ea97743be6a8774479 new file mode 100644 index 000000000..5df58dda5 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/84/96071c1b46c854b31185ea97743be6a8774479 differ diff --git a/tests/resources/testrepo/.gitted/objects/94/4c0f6e4dfa41595e6eb3ceecdb14f50fe18162 b/tests/resources/testrepo/.gitted/objects/94/4c0f6e4dfa41595e6eb3ceecdb14f50fe18162 new file mode 100644 index 000000000..4cc3f4dff Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/94/4c0f6e4dfa41595e6eb3ceecdb14f50fe18162 differ diff --git a/tests/resources/testrepo/.gitted/objects/9a/03079b8a8ee85a0bee58bf9be3da8b62414ed4 b/tests/resources/testrepo/.gitted/objects/9a/03079b8a8ee85a0bee58bf9be3da8b62414ed4 new file mode 100644 index 000000000..bf7b2bb68 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/9a/03079b8a8ee85a0bee58bf9be3da8b62414ed4 differ diff --git a/tests/resources/testrepo/.gitted/objects/9f/d738e8f7967c078dceed8190330fc8648ee56a b/tests/resources/testrepo/.gitted/objects/9f/d738e8f7967c078dceed8190330fc8648ee56a new file mode 100644 index 000000000..a79612435 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/9f/d738e8f7967c078dceed8190330fc8648ee56a differ diff --git a/tests/resources/testrepo/.gitted/objects/a4/a7dce85cf63874e984719f4fdd239f5145052f b/tests/resources/testrepo/.gitted/objects/a4/a7dce85cf63874e984719f4fdd239f5145052f new file mode 100644 index 000000000..f8588696b Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/a4/a7dce85cf63874e984719f4fdd239f5145052f differ diff --git a/tests/resources/testrepo/.gitted/objects/a6/5fedf39aefe402d3bb6e24df4d4f5fe4547750 b/tests/resources/testrepo/.gitted/objects/a6/5fedf39aefe402d3bb6e24df4d4f5fe4547750 new file mode 100644 index 000000000..29c8e824d Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/a6/5fedf39aefe402d3bb6e24df4d4f5fe4547750 differ diff --git a/tests/resources/testrepo/.gitted/objects/a7/1586c1dfe8a71c6cbf6c129f404c5642ff31bd b/tests/resources/testrepo/.gitted/objects/a7/1586c1dfe8a71c6cbf6c129f404c5642ff31bd new file mode 100644 index 000000000..d0d7e736e Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/a7/1586c1dfe8a71c6cbf6c129f404c5642ff31bd differ diff --git a/tests/resources/testrepo/.gitted/objects/a8/233120f6ad708f843d861ce2b7228ec4e3dec6 b/tests/resources/testrepo/.gitted/objects/a8/233120f6ad708f843d861ce2b7228ec4e3dec6 new file mode 100644 index 000000000..18a7f61c2 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/a8/233120f6ad708f843d861ce2b7228ec4e3dec6 differ diff --git a/tests/resources/testrepo/.gitted/objects/ae/90f12eea699729ed24555e40b9fd669da12a12 b/tests/resources/testrepo/.gitted/objects/ae/90f12eea699729ed24555e40b9fd669da12a12 new file mode 100644 index 000000000..d95254674 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/ae/90f12eea699729ed24555e40b9fd669da12a12 differ diff --git a/tests/resources/testrepo/.gitted/objects/b2/5fa35b38051e4ae45d4222e795f9df2e43f1d1 b/tests/resources/testrepo/.gitted/objects/b2/5fa35b38051e4ae45d4222e795f9df2e43f1d1 new file mode 100644 index 000000000..f460f2547 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/b2/5fa35b38051e4ae45d4222e795f9df2e43f1d1 differ diff --git a/tests/resources/testrepo/.gitted/objects/b6/361fc6a97178d8fc8639fdeed71c775ab52593 b/tests/resources/testrepo/.gitted/objects/b6/361fc6a97178d8fc8639fdeed71c775ab52593 new file mode 100644 index 000000000..f613670e2 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/b6/361fc6a97178d8fc8639fdeed71c775ab52593 differ diff --git a/tests/resources/testrepo/.gitted/objects/be/3563ae3f795b2b4353bcce3a527ad0a4f7f644 b/tests/resources/testrepo/.gitted/objects/be/3563ae3f795b2b4353bcce3a527ad0a4f7f644 new file mode 100644 index 000000000..0817229bc Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/be/3563ae3f795b2b4353bcce3a527ad0a4f7f644 differ diff --git a/tests/resources/testrepo/.gitted/objects/c4/7800c7266a2be04c571c04d5a6614691ea99bd b/tests/resources/testrepo/.gitted/objects/c4/7800c7266a2be04c571c04d5a6614691ea99bd new file mode 100644 index 000000000..75f541f10 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/c4/7800c7266a2be04c571c04d5a6614691ea99bd differ diff --git a/tests/resources/testrepo/.gitted/objects/d6/c93164c249c8000205dd4ec5cbca1b516d487f b/tests/resources/testrepo/.gitted/objects/d6/c93164c249c8000205dd4ec5cbca1b516d487f new file mode 100644 index 000000000..a67d6e647 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/d6/c93164c249c8000205dd4ec5cbca1b516d487f differ diff --git a/tests/resources/testrepo/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/tests/resources/testrepo/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 new file mode 100644 index 000000000..711223894 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 differ diff --git a/tests/resources/testrepo/.gitted/objects/e7/b4ad382349ff96dd8199000580b9b1e2042eb0 b/tests/resources/testrepo/.gitted/objects/e7/b4ad382349ff96dd8199000580b9b1e2042eb0 new file mode 100644 index 000000000..b135eccda Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/e7/b4ad382349ff96dd8199000580b9b1e2042eb0 differ diff --git a/tests/resources/testrepo/.gitted/objects/f1/425cef211cc08caa31e7b545ffb232acb098c3 b/tests/resources/testrepo/.gitted/objects/f1/425cef211cc08caa31e7b545ffb232acb098c3 new file mode 100644 index 000000000..82e2790e8 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/f1/425cef211cc08caa31e7b545ffb232acb098c3 differ diff --git a/tests/resources/testrepo/.gitted/objects/f6/0079018b664e4e79329a7ef9559c8d9e0378d1 b/tests/resources/testrepo/.gitted/objects/f6/0079018b664e4e79329a7ef9559c8d9e0378d1 new file mode 100644 index 000000000..697c94c92 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/f6/0079018b664e4e79329a7ef9559c8d9e0378d1 differ diff --git a/tests/resources/testrepo/.gitted/objects/fa/49b077972391ad58037050f2a75f74e3671e92 b/tests/resources/testrepo/.gitted/objects/fa/49b077972391ad58037050f2a75f74e3671e92 new file mode 100644 index 000000000..112998d42 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/fa/49b077972391ad58037050f2a75f74e3671e92 differ diff --git a/tests/resources/testrepo/.gitted/objects/fd/093bff70906175335656e6ce6ae05783708765 b/tests/resources/testrepo/.gitted/objects/fd/093bff70906175335656e6ce6ae05783708765 new file mode 100644 index 000000000..12bf5f3e3 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/fd/093bff70906175335656e6ce6ae05783708765 differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx b/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx new file mode 100644 index 000000000..5068f2818 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.pack b/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.pack new file mode 100644 index 000000000..a6a1f3020 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.pack differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.idx b/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.idx new file mode 100644 index 000000000..94c3c71da Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.idx differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.pack b/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.pack new file mode 100644 index 000000000..74c7fe4f3 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-d7c6adf9f61318f041845b01440d09aa7a91e1b5.pack differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.idx b/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.idx new file mode 100644 index 000000000..555cfa977 Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.idx differ diff --git a/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.pack b/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.pack new file mode 100644 index 000000000..4d539ed0a Binary files /dev/null and b/tests/resources/testrepo/.gitted/objects/pack/pack-d85f5d483273108c9d8dd0e4728ccf0b2982423a.pack differ diff --git a/tests/resources/testrepo/.gitted/packed-refs b/tests/resources/testrepo/.gitted/packed-refs new file mode 100644 index 000000000..52f5e876f Binary files /dev/null and b/tests/resources/testrepo/.gitted/packed-refs differ diff --git a/tests/resources/testrepo/.gitted/refs/heads/br2 b/tests/resources/testrepo/.gitted/refs/heads/br2 new file mode 100644 index 000000000..aab87e5e7 Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/heads/br2 differ diff --git a/tests/resources/testrepo/.gitted/refs/heads/master b/tests/resources/testrepo/.gitted/refs/heads/master new file mode 100644 index 000000000..3d8f0a402 Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/heads/master differ diff --git a/tests/resources/testrepo/.gitted/refs/heads/packed-test b/tests/resources/testrepo/.gitted/refs/heads/packed-test new file mode 100644 index 000000000..f2c14ad83 Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/heads/packed-test differ diff --git a/tests/resources/testrepo/.gitted/refs/heads/subtrees b/tests/resources/testrepo/.gitted/refs/heads/subtrees new file mode 100644 index 000000000..ad27e0b13 Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/heads/subtrees differ diff --git a/tests/resources/testrepo/.gitted/refs/heads/test b/tests/resources/testrepo/.gitted/refs/heads/test new file mode 100644 index 000000000..399c4c73e Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/heads/test differ diff --git a/tests/resources/testrepo/.gitted/refs/tags/e90810b b/tests/resources/testrepo/.gitted/refs/tags/e90810b new file mode 100644 index 000000000..584495d3c Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/tags/e90810b differ diff --git a/tests/resources/testrepo/.gitted/refs/tags/point_to_blob b/tests/resources/testrepo/.gitted/refs/tags/point_to_blob new file mode 100644 index 000000000..f874a3ffc Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/tags/point_to_blob differ diff --git a/tests/resources/testrepo/.gitted/refs/tags/test b/tests/resources/testrepo/.gitted/refs/tags/test new file mode 100644 index 000000000..6ee952a03 Binary files /dev/null and b/tests/resources/testrepo/.gitted/refs/tags/test differ