Commit a6359408 by Vicent Marti

Use Z_BEST_SPEED for filebuf deflating

This is what Git uses by default for all deflating.
parent fff036ec
......@@ -178,7 +178,7 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags)
if (flags & GIT_FILEBUF_DEFLATE_CONTENTS) {
/* Initialize the ZLib stream */
if (deflateInit(&file->zs, Z_DEFAULT_COMPRESSION) != Z_OK) {
if (deflateInit(&file->zs, Z_BEST_SPEED) != Z_OK) {
error = GIT_EZLIB;
goto cleanup;
}
......
......@@ -136,7 +136,7 @@ BEGIN_TEST(write2, "write a tree from a memory")
git_tree *tree;
git_oid id, bid, rid, id2;
must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
git_oid_mkstr(&id, first_tree);
git_oid_mkstr(&id2, second_tree);
git_oid_mkstr(&bid, blob_oid);
......@@ -148,6 +148,7 @@ BEGIN_TEST(write2, "write a tree from a memory")
must_pass(git_treebuilder_write(&rid,repo,builder));
must_be_true(git_oid_cmp(&rid, &id2) == 0);
close_temp_repo(repo);
END_TEST
BEGIN_SUITE(tree)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment