summaryrefslogtreecommitdiff
path: root/tests/commit
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-02-28 15:51:38 -0500
committerEdward Thomson <ethomson@github.com>2016-02-28 18:59:43 -0500
commitf2dddf52c041ff2f9185bdb320ddccad1523a2bf (patch)
tree6e818814d93e1781c51da842e6c02529a17167b6 /tests/commit
parent4afe536ba1c909ff8ab8d1b75997d3897b72571b (diff)
downloadlibgit2-f2dddf52c041ff2f9185bdb320ddccad1523a2bf.tar.gz
turn on strict object validation by default
Diffstat (limited to 'tests/commit')
-rw-r--r--tests/commit/write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/commit/write.c b/tests/commit/write.c
index 303d1ce58..96b7cc321 100644
--- a/tests/commit/write.c
+++ b/tests/commit/write.c
@@ -38,7 +38,7 @@ void test_commit_write__cleanup(void)
cl_git_sandbox_cleanup();
- cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0));
+ cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1));
}
@@ -196,10 +196,12 @@ static int create_commit_from_ids(
return ret;
}
-void test_commit_write__doesnt_validate_objects_by_default(void)
+void test_commit_write__can_write_invalid_objects(void)
{
git_oid expected_id, tree_id, parent_id, commit_id;
+ cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0));
+
/* this is a valid tree and parent */
git_oid_fromstr(&tree_id, tree_id_str);
git_oid_fromstr(&parent_id, parent_id_str);
@@ -237,8 +239,6 @@ void test_commit_write__can_validate_objects(void)
{
git_oid tree_id, parent_id, commit_id;
- cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1));
-
/* this is a valid tree and parent */
git_oid_fromstr(&tree_id, tree_id_str);
git_oid_fromstr(&parent_id, parent_id_str);