mirror of
https://github.com/git/git
synced 2024-10-29 17:08:46 +00:00
Merge branch 'np/maint-no-ofs-delta' into maint
* np/maint-no-ofs-delta: honor repack.usedeltabaseoffset when fetching packs
This commit is contained in:
commit
69fd60a649
1 changed files with 12 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
||||||
static int transfer_unpack_limit = -1;
|
static int transfer_unpack_limit = -1;
|
||||||
static int fetch_unpack_limit = -1;
|
static int fetch_unpack_limit = -1;
|
||||||
static int unpack_limit = 100;
|
static int unpack_limit = 100;
|
||||||
|
static int prefer_ofs_delta = 1;
|
||||||
static struct fetch_pack_args args = {
|
static struct fetch_pack_args args = {
|
||||||
/* .uploadpack = */ "git-upload-pack",
|
/* .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.use_thin_pack ? " thin-pack" : ""),
|
||||||
(args.no_progress ? " no-progress" : ""),
|
(args.no_progress ? " no-progress" : ""),
|
||||||
(args.include_tag ? " include-tag" : ""),
|
(args.include_tag ? " include-tag" : ""),
|
||||||
" ofs-delta");
|
(prefer_ofs_delta ? " ofs-delta" : ""));
|
||||||
else
|
else
|
||||||
packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
|
packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
|
||||||
fetching++;
|
fetching++;
|
||||||
|
@ -597,6 +598,11 @@ static struct ref *do_fetch_pack(int fd[2],
|
||||||
fprintf(stderr, "Server supports side-band\n");
|
fprintf(stderr, "Server supports side-band\n");
|
||||||
use_sideband = 1;
|
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)) {
|
if (everything_local(&ref, nr_match, match)) {
|
||||||
packet_flush(fd[1]);
|
packet_flush(fd[1]);
|
||||||
goto all_done;
|
goto all_done;
|
||||||
|
@ -649,6 +655,11 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
|
||||||
return 0;
|
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);
|
return git_default_config(var, value, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue