22
22
23
23
KHASH_INIT (str , const char * , void * , 1 , kh_str_hash_func , kh_str_hash_equal )
24
24
25
- static khash_sha1 * island_marks ;
25
+ static kh_oid_map_t * island_marks ;
26
26
static unsigned island_counter ;
27
27
static unsigned island_counter_core ;
28
28
@@ -105,15 +105,15 @@ int in_same_island(const struct object_id *trg_oid, const struct object_id *src_
105
105
* If we don't have a bitmap for the target, we can delta it
106
106
* against anything -- it's not an important object
107
107
*/
108
- trg_pos = kh_get_sha1 (island_marks , trg_oid -> hash );
108
+ trg_pos = kh_get_oid_map (island_marks , * trg_oid );
109
109
if (trg_pos >= kh_end (island_marks ))
110
110
return 1 ;
111
111
112
112
/*
113
113
* if the source (our delta base) doesn't have a bitmap,
114
114
* we don't want to base any deltas on it!
115
115
*/
116
- src_pos = kh_get_sha1 (island_marks , src_oid -> hash );
116
+ src_pos = kh_get_oid_map (island_marks , * src_oid );
117
117
if (src_pos >= kh_end (island_marks ))
118
118
return 0 ;
119
119
@@ -129,11 +129,11 @@ int island_delta_cmp(const struct object_id *a, const struct object_id *b)
129
129
if (!island_marks )
130
130
return 0 ;
131
131
132
- a_pos = kh_get_sha1 (island_marks , a -> hash );
132
+ a_pos = kh_get_oid_map (island_marks , * a );
133
133
if (a_pos < kh_end (island_marks ))
134
134
a_bitmap = kh_value (island_marks , a_pos );
135
135
136
- b_pos = kh_get_sha1 (island_marks , b -> hash );
136
+ b_pos = kh_get_oid_map (island_marks , * b );
137
137
if (b_pos < kh_end (island_marks ))
138
138
b_bitmap = kh_value (island_marks , b_pos );
139
139
@@ -154,7 +154,7 @@ static struct island_bitmap *create_or_get_island_marks(struct object *obj)
154
154
khiter_t pos ;
155
155
int hash_ret ;
156
156
157
- pos = kh_put_sha1 (island_marks , obj -> oid . hash , & hash_ret );
157
+ pos = kh_put_oid_map (island_marks , obj -> oid , & hash_ret );
158
158
if (hash_ret )
159
159
kh_value (island_marks , pos ) = island_bitmap_new (NULL );
160
160
@@ -167,7 +167,7 @@ static void set_island_marks(struct object *obj, struct island_bitmap *marks)
167
167
khiter_t pos ;
168
168
int hash_ret ;
169
169
170
- pos = kh_put_sha1 (island_marks , obj -> oid . hash , & hash_ret );
170
+ pos = kh_put_oid_map (island_marks , obj -> oid , & hash_ret );
171
171
if (hash_ret ) {
172
172
/*
173
173
* We don't have one yet; make a copy-on-write of the
@@ -279,7 +279,7 @@ void resolve_tree_islands(struct repository *r,
279
279
struct name_entry entry ;
280
280
khiter_t pos ;
281
281
282
- pos = kh_get_sha1 (island_marks , ent -> idx .oid . hash );
282
+ pos = kh_get_oid_map (island_marks , ent -> idx .oid );
283
283
if (pos >= kh_end (island_marks ))
284
284
continue ;
285
285
@@ -456,7 +456,7 @@ static void deduplicate_islands(struct repository *r)
456
456
457
457
void load_delta_islands (struct repository * r )
458
458
{
459
- island_marks = kh_init_sha1 ();
459
+ island_marks = kh_init_oid_map ();
460
460
remote_islands = kh_init_str ();
461
461
462
462
git_config (island_config_callback , NULL );
@@ -468,7 +468,7 @@ void load_delta_islands(struct repository *r)
468
468
469
469
void propagate_island_marks (struct commit * commit )
470
470
{
471
- khiter_t pos = kh_get_sha1 (island_marks , commit -> object .oid . hash );
471
+ khiter_t pos = kh_get_oid_map (island_marks , commit -> object .oid );
472
472
473
473
if (pos < kh_end (island_marks )) {
474
474
struct commit_list * p ;
@@ -490,7 +490,7 @@ int compute_pack_layers(struct packing_data *to_pack)
490
490
491
491
for (i = 0 ; i < to_pack -> nr_objects ; ++ i ) {
492
492
struct object_entry * entry = & to_pack -> objects [i ];
493
- khiter_t pos = kh_get_sha1 (island_marks , entry -> idx .oid . hash );
493
+ khiter_t pos = kh_get_oid_map (island_marks , entry -> idx .oid );
494
494
495
495
oe_set_layer (to_pack , entry , 1 );
496
496
0 commit comments