Use Z_BEST_SPEED for filebuf deflating

This is what Git uses by default for all deflating.
This commit is contained in:
Vicent Marti 2011-04-10 12:23:55 -07:00
parent fff036ec15
commit a6359408a5
2 changed files with 3 additions and 2 deletions

View File

@ -178,7 +178,7 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags)
if (flags & GIT_FILEBUF_DEFLATE_CONTENTS) { if (flags & GIT_FILEBUF_DEFLATE_CONTENTS) {
/* Initialize the ZLib stream */ /* 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; error = GIT_EZLIB;
goto cleanup; goto cleanup;
} }

View File

@ -136,7 +136,7 @@ BEGIN_TEST(write2, "write a tree from a memory")
git_tree *tree; git_tree *tree;
git_oid id, bid, rid, id2; 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(&id, first_tree);
git_oid_mkstr(&id2, second_tree); git_oid_mkstr(&id2, second_tree);
git_oid_mkstr(&bid, blob_oid); 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_pass(git_treebuilder_write(&rid,repo,builder));
must_be_true(git_oid_cmp(&rid, &id2) == 0); must_be_true(git_oid_cmp(&rid, &id2) == 0);
close_temp_repo(repo);
END_TEST END_TEST
BEGIN_SUITE(tree) BEGIN_SUITE(tree)