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.
diff --git a/src/transports/local.c b/src/transports/local.c
index 64ddbd9..def8ac0 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -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)