Merge pull request #1283 from lznuaa/master

Fix local repository clone failure
This commit is contained in:
Vicent Martí 2013-01-27 13:15:48 -08:00
commit e1859ea184

View File

@ -318,12 +318,15 @@ static int local_download_pack(
if (!git_object_lookup((git_object**)&commit, t->repo, &oid, GIT_OBJ_COMMIT)) {
const git_oid *tree_oid = git_commit_tree_id(commit);
git_commit_free(commit);
/* Add the commit and its tree */
if ((error = git_packbuilder_insert(pack, &oid, NULL)) < 0 ||
(error = git_packbuilder_insert_tree(pack, tree_oid)) < 0)
(error = git_packbuilder_insert_tree(pack, tree_oid)) < 0) {
git_commit_free(commit);
goto cleanup;
}
git_commit_free(commit);
}
}