summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2dc04b)
raw | patch | inline | side by side (parent: a2dc04b)
author | Nicolas Pitre <nico@cam.org> | |
Sat, 2 May 2009 00:18:02 +0000 (20:18 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 2 May 2009 05:13:43 +0000 (22:13 -0700) |
If the local receiving repository has disabled the use of delta base
offset, for example to retain compatibility with older versions of
Git that predate OFS_DELTA, we shouldn't ask for ofs-delta support
when we obtain a pack from the remote server.
[ issue noticed by Shawn Pearce ]
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
offset, for example to retain compatibility with older versions of
Git that predate OFS_DELTA, we shouldn't ask for ofs-delta support
when we obtain a pack from the remote server.
[ issue noticed by Shawn Pearce ]
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c | patch | blob | history |
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 67fb80ec48d6d8f0327628afd86fb366d8f97617..1effdc0d6b88c2a69ea36f18593556fc83a14fbf 100644 (file)
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
static int unpack_limit = 100;
+static int prefer_ofs_delta = 1;
static struct fetch_pack_args args = {
/* .uploadpack = */ "git-upload-pack",
};
(args.use_thin_pack ? " thin-pack" : ""),
(args.no_progress ? " no-progress" : ""),
(args.include_tag ? " include-tag" : ""),
- " ofs-delta");
+ (prefer_ofs_delta ? " ofs-delta" : ""));
else
packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
fetching++;
fprintf(stderr, "Server supports side-band\n");
use_sideband = 1;
}
+ if (server_supports("ofs-delta")) {
+ if (args.verbose)
+ fprintf(stderr, "Server supports ofs-delta\n");
+ } else
+ prefer_ofs_delta = 0;
if (everything_local(&ref, nr_match, match)) {
packet_flush(fd[1]);
goto all_done;
return 0;
}
+ if (strcmp(var, "repack.usedeltabaseoffset") == 0) {
+ prefer_ofs_delta = git_config_bool(var, value);
+ return 0;
+ }
+
return git_default_config(var, value, cb);
}