local: recusrively insert non-branch objects into the packfile

When we insert e.g. a tag or tagged object into the packfile, we must
make sure to insert any referenced objects as well, or we will have
broken links.

Use the recursive version of packfile insertion to make sure we send
over not just the tagged object but also the objects it references.
This commit is contained in:
Carlos Martín Nieto 2015-03-12 01:52:15 +01:00
parent 84511143fd
commit c84a9dd2da

View File

@ -544,7 +544,8 @@ static int local_download_pack(
error = 0;
}
} else {
error = git_packbuilder_insert(pack, &rhead->oid, rhead->name);
/* Tag or some other wanted object. Add it on its own */
error = git_packbuilder_insert_recur(pack, &rhead->oid, rhead->name);
}
git_object_free(obj);
if (error < 0)