@@ -3283,33 +3283,6 @@ static int add_ref_tag(const char *tag UNUSED, const char *referent UNUSED, cons
3283
3283
return 0 ;
3284
3284
}
3285
3285
3286
- static int should_attempt_deltas (struct object_entry * entry )
3287
- {
3288
- if (DELTA (entry ))
3289
- return 0 ;
3290
-
3291
- if (!entry -> type_valid ||
3292
- oe_size_less_than (& to_pack , entry , 50 ))
3293
- return 0 ;
3294
-
3295
- if (entry -> no_try_delta )
3296
- return 0 ;
3297
-
3298
- if (!entry -> preferred_base ) {
3299
- if (oe_type (entry ) < 0 )
3300
- die (_ ("unable to get type of object %s" ),
3301
- oid_to_hex (& entry -> idx .oid ));
3302
- } else if (oe_type (entry ) < 0 ) {
3303
- /*
3304
- * This object is not found, but we
3305
- * don't have to include it anyway.
3306
- */
3307
- return 0 ;
3308
- }
3309
-
3310
- return 1 ;
3311
- }
3312
-
3313
3286
static void prepare_pack (int window , int depth )
3314
3287
{
3315
3288
struct object_entry * * delta_list ;
@@ -3340,11 +3313,33 @@ static void prepare_pack(int window, int depth)
3340
3313
for (i = 0 ; i < to_pack .nr_objects ; i ++ ) {
3341
3314
struct object_entry * entry = to_pack .objects + i ;
3342
3315
3343
- if (!should_attempt_deltas (entry ))
3316
+ if (DELTA (entry ))
3317
+ /* This happens if we decided to reuse existing
3318
+ * delta from a pack. "reuse_delta &&" is implied.
3319
+ */
3344
3320
continue ;
3345
3321
3346
- if (!entry -> preferred_base )
3322
+ if (!entry -> type_valid ||
3323
+ oe_size_less_than (& to_pack , entry , 50 ))
3324
+ continue ;
3325
+
3326
+ if (entry -> no_try_delta )
3327
+ continue ;
3328
+
3329
+ if (!entry -> preferred_base ) {
3347
3330
nr_deltas ++ ;
3331
+ if (oe_type (entry ) < 0 )
3332
+ die (_ ("unable to get type of object %s" ),
3333
+ oid_to_hex (& entry -> idx .oid ));
3334
+ } else {
3335
+ if (oe_type (entry ) < 0 ) {
3336
+ /*
3337
+ * This object is not found, but we
3338
+ * don't have to include it anyway.
3339
+ */
3340
+ continue ;
3341
+ }
3342
+ }
3348
3343
3349
3344
delta_list [n ++ ] = entry ;
3350
3345
}
0 commit comments