190
191
static const char *const pack_usage[] = {
192
N_("git pack-objects [-q | --progress | --all-progress] [--all-progress-implied]\n"
193
- " [--no-reuse-delta] [--delta-base-offset] [--non-empty]\n"
193
+ " [--no-reuse-delta] [--delta-base-offset] [--no-ref-delta]\n"
194
+ " [--non-empty]\n"
195
" [--local] [--incremental] [--window=<n>] [--depth=<n>]\n"
196
" [--revs [--unpacked | --all]] [--keep-pack=<pack-name>]\n"
197
" [--cruft] [--cruft-expiration=<time>]\n"
222
static int ignore_packed_keep_in_core_open;
223
static int ignore_packed_keep_in_core_has_cruft;
224
static int allow_ofs_delta;
225
+static int allow_ref_delta = 1;
226
static struct pack_idx_option pack_idx_opts;
227
static const char *base_name;
228
static int progress = 1;
3407
if (entry->no_try_delta)
3408
return 0;
3409
3410
+ if (entry->preferred_base && !allow_ref_delta)
3411
+ return 0;
3412
+
3413
if (!entry->preferred_base) {
3414
if (oe_type(entry) < 0)
3415
die(_("unable to get type of object %s"),
3652
if (!pack_to_stdout)
3653
do_check_packed_object_crc = 1;
3654
3650
- if (!to_pack.nr_objects || !window || !depth)
3655
+ if (!to_pack.nr_objects || !window || !depth ||
3656
+ (!allow_ref_delta && !allow_ofs_delta))
3657
return;
3658
3659
if (path_walk)
4668
!ignore_packed_keep_on_disk &&
4669
!ignore_packed_keep_in_core &&
4670
(!local || !have_non_local_packs) &&
4665
- !incremental;
4671
+ !incremental && allow_ref_delta;
4672
}
4673
4674
static int get_object_list_from_bitmap(struct rev_info *revs)
5117
N_("reuse existing objects")),
5118
OPT_BOOL(0, "delta-base-offset", &allow_ofs_delta,
5119
N_("use OFS_DELTA objects")),
5120
+ OPT_BOOL(0, "ref-delta", &allow_ref_delta,
5121
+ N_("use REF_DELTA objects")),
5122
OPT_INTEGER(0, "threads", &delta_search_threads,
5123
N_("use threads when searching for best delta matches")),
5124
OPT_BOOL(0, "non-empty", &non_empty,
5317
if (unpack_unreachable || keep_unreachable || pack_loose_unreachable)
5318
use_internal_rev_list = 1;
5319
5312
- if (!reuse_object)
5320
+ if (!reuse_object || !allow_ref_delta)
5321
reuse_delta = 0;
5322
if (cfg->pack_compression_level == -1)
5323
cfg->pack_compression_level = Z_DEFAULT_COMPRESSION;