Commit a6359408a525e5ef8945d8b7a3da2a4a1c4cc424

Vicent Marti 2011-04-10T12:23:55

Use Z_BEST_SPEED for filebuf deflating This is what Git uses by default for all deflating.

diff --git a/src/filebuf.c b/src/filebuf.c
index dff9373..eb93424 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -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;
 		}
diff --git a/tests/t09-tree.c b/tests/t09-tree.c
index 1a1d504..bd88642 100644
--- a/tests/t09-tree.c
+++ b/tests/t09-tree.c
@@ -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)