summaryrefslogtreecommitdiff
path: root/builtin-fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-03 23:46:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-05-03 23:55:38 (GMT)
commit3536ae331014c68a25c80b3fb530a19c8dee0f11 (patch)
tree6516e133a732a756e8c00e49ceb5b6e9264f42c1 /builtin-fetch-pack.c
parent503f464090d835ad333f5a55662ca0880c7b1d44 (diff)
parenta48f5d7153761fabf0b04fdfd1667adf7eeeddbe (diff)
downloadgit-3536ae331014c68a25c80b3fb530a19c8dee0f11.zip
git-3536ae331014c68a25c80b3fb530a19c8dee0f11.tar.gz
git-3536ae331014c68a25c80b3fb530a19c8dee0f11.tar.bz2
Sync with GIT 1.6.2.5
Diffstat (limited to 'builtin-fetch-pack.c')
-rw-r--r--builtin-fetch-pack.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index cbe5f20..87f46c6 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -13,6 +13,7 @@
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",
};
@@ -200,7 +201,7 @@ static int find_common(int fd[2], unsigned char *result_sha1,
(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++;
@@ -596,6 +597,11 @@ static struct ref *do_fetch_pack(int fd[2],
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;
@@ -648,6 +654,11 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
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);
}