mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-14 09:36:08 +00:00
Fix fail clone local repository because can't found object
avoid use object which is already free Signed-off-by: Frank Li <lznuaa@gmail.com>
This commit is contained in:
parent
aa3bf89df2
commit
88183c1988
@ -318,13 +318,16 @@ static int local_download_pack(
|
|||||||
|
|
||||||
if (!git_object_lookup((git_object**)&commit, t->repo, &oid, GIT_OBJ_COMMIT)) {
|
if (!git_object_lookup((git_object**)&commit, t->repo, &oid, GIT_OBJ_COMMIT)) {
|
||||||
const git_oid *tree_oid = git_commit_tree_id(commit);
|
const git_oid *tree_oid = git_commit_tree_id(commit);
|
||||||
git_commit_free(commit);
|
|
||||||
|
|
||||||
/* Add the commit and its tree */
|
/* Add the commit and its tree */
|
||||||
if ((error = git_packbuilder_insert(pack, &oid, NULL)) < 0 ||
|
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;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_commit_free(commit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error = git_odb_write_pack(&writepack, odb, progress_cb, progress_payload)) < 0)
|
if ((error = git_odb_write_pack(&writepack, odb, progress_cb, progress_payload)) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user