@matheusbsbs / matheus-bagliano / commits / 787d2a784b
Fork 0

bundle: Use OFS_DELTA in bundle files

git-bundle first appeared in 2e0afafe ("Add git-bundle") in Feb 2007, and first shipped in Git 1.5.1. However, OFS_DELTA is an even earlier invention, coming about in eb32d236 ("introduce delta objects with offset to base") in Sep 2006, and first shipped in Git 1.4.4.5. OFS_DELTA is smaller, about 3.2%-5% smaller, and is typically faster to access than REF_DELTA because the exact location of the delta base is available after parsing the object header. Since all bundle aware versions of Git are also OFS_DELTA aware, just make it the default. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shawn O. Pearce committed Feb 5, 2011 at 16:58 UTC 787d2a784b1d5d9c59c0098533ce9fdb757942d9
1 file changed +3 -2
bundle.c
+3 -2
@@ -200,7 +200,7 @@ int create_bundle(struct bundle_header *header, const char *path,
200 int bundle_fd = -1;
201 int bundle_to_stdout;
202 const char **argv_boundary = xmalloc((argc + 4) * sizeof(const char *));
203 - const char **argv_pack = xmalloc(5 * sizeof(const char *));
203 + const char **argv_pack = xmalloc(6 * sizeof(const char *));
204 int i, ref_count = 0;
205 char buffer[1024];
206 struct rev_info revs;
@@ -346,7 +346,8 @@ int create_bundle(struct bundle_header *header, const char *path,
346 argv_pack[1] = "--all-progress-implied";
347 argv_pack[2] = "--stdout";
348 argv_pack[3] = "--thin";
349 - argv_pack[4] = NULL;
349 + argv_pack[4] = "--delta-base-offset";
350 + argv_pack[5] = NULL;
351 memset(&rls, 0, sizeof(rls));
352 rls.argv = argv_pack;
353 rls.in = -1;