summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-03-12 01:52:15 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2015-03-17 20:51:47 +0100
commitc84a9dd2da864a975b5dee408e3edaf84422b828 (patch)
tree8fd4e9af18dfd5c03df60bae46c8f929359721f4
parent84511143fd1ec92ee7bc8888141aa2bf2074e9f9 (diff)
downloadlibgit2-cmn/clone-everything.tar.gz
local: recusrively insert non-branch objects into the packfilecmn/clone-everything
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.
-rw-r--r--src/transports/local.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index 64ddbd970..def8ac037 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)