@matheusbsbs / matheus-bagliano / commits / 2245be3e7a
Fork 0

send-pack --thin: use "thin pack" delta transfer.

The new flag loosens the usual "self containedness" requirment of packfiles, and sends deltified representation of objects when we know the other side has the base objects needed to unpack them. This would help reducing the transfer size. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 19, 2006 at 15:03 UTC 2245be3e7a5a2999ebf7d38e569c98994b0cda31
1 file changed +9 -1
send-pack.c
+9 -1
@@ -12,6 +12,7 @@ static const char *exec = "git-receive-pack";
12 static int verbose = 0;
13 static int send_all = 0;
14 static int force_update = 0;
15 +static int use_thin_pack = 0;
16
17 static int is_zero_sha1(const unsigned char *sha1)
18 {
@@ -41,7 +42,10 @@ static void exec_rev_list(struct ref *refs)
42 int i = 0;
43
44 args[i++] = "rev-list"; /* 0 */
44 - args[i++] = "--objects"; /* 1 */
45 + if (use_thin_pack) /* 1 */
46 + args[i++] = "--objects-edge";
47 + else
48 + args[i++] = "--objects";
49 while (refs) {
50 char *buf = malloc(100);
51 if (i > 900)
@@ -361,6 +365,10 @@ int main(int argc, char **argv)
365 verbose = 1;
366 continue;
367 }
368 + if (!strcmp(arg, "--thin")) {
369 + use_thin_pack = 1;
370 + continue;
371 + }
372 usage(send_pack_usage);
373 }
374 if (!dest) {