@@ -139,7 +139,7 @@ static struct ewah_bitmap *read_bitmap_1(struct bitmap_index *index)
139
139
index -> map_size - index -> map_pos );
140
140
141
141
if (bitmap_size < 0 ) {
142
- error ("failed to load bitmap index (corrupted?)" );
142
+ error (_ ( "failed to load bitmap index (corrupted?)" ) );
143
143
ewah_pool_free (b );
144
144
return NULL ;
145
145
}
@@ -161,14 +161,14 @@ static int load_bitmap_header(struct bitmap_index *index)
161
161
size_t header_size = sizeof (* header ) - GIT_MAX_RAWSZ + the_hash_algo -> rawsz ;
162
162
163
163
if (index -> map_size < header_size + the_hash_algo -> rawsz )
164
- return error ("corrupted bitmap index (too small)" );
164
+ return error (_ ( "corrupted bitmap index (too small)" ) );
165
165
166
166
if (memcmp (header -> magic , BITMAP_IDX_SIGNATURE , sizeof (BITMAP_IDX_SIGNATURE )) != 0 )
167
- return error ("corrupted bitmap index file (wrong header)" );
167
+ return error (_ ( "corrupted bitmap index file (wrong header)" ) );
168
168
169
169
index -> version = ntohs (header -> version );
170
170
if (index -> version != 1 )
171
- return error ("unsupported version '%d' for bitmap index file" , index -> version );
171
+ return error (_ ( "unsupported version '%d' for bitmap index file" ) , index -> version );
172
172
173
173
/* Parse known bitmap format options */
174
174
{
@@ -182,7 +182,7 @@ static int load_bitmap_header(struct bitmap_index *index)
182
182
183
183
if (flags & BITMAP_OPT_HASH_CACHE ) {
184
184
if (cache_size > index_end - index -> map - header_size )
185
- return error ("corrupted bitmap index file (too short to fit hash cache)" );
185
+ return error (_ ( "corrupted bitmap index file (too short to fit hash cache)" ) );
186
186
index -> hashes = (void * )(index_end - cache_size );
187
187
index_end -= cache_size ;
188
188
}
@@ -216,7 +216,7 @@ static struct stored_bitmap *store_bitmap(struct bitmap_index *index,
216
216
* because the SHA1 already existed on the map. this is bad, there
217
217
* shouldn't be duplicated commits in the index */
218
218
if (ret == 0 ) {
219
- error ("duplicate entry in bitmap index: '%s'" , oid_to_hex (oid ));
219
+ error (_ ( "duplicate entry in bitmap index: '%s'" ) , oid_to_hex (oid ));
220
220
return NULL ;
221
221
}
222
222
@@ -260,28 +260,28 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
260
260
struct object_id oid ;
261
261
262
262
if (index -> map_size - index -> map_pos < 6 )
263
- return error ("corrupt ewah bitmap: truncated header for entry %d" , i );
263
+ return error (_ ( "corrupt ewah bitmap: truncated header for entry %d" ) , i );
264
264
265
265
commit_idx_pos = read_be32 (index -> map , & index -> map_pos );
266
266
xor_offset = read_u8 (index -> map , & index -> map_pos );
267
267
flags = read_u8 (index -> map , & index -> map_pos );
268
268
269
269
if (nth_bitmap_object_oid (index , & oid , commit_idx_pos ) < 0 )
270
- return error ("corrupt ewah bitmap: commit index %u out of range" ,
270
+ return error (_ ( "corrupt ewah bitmap: commit index %u out of range" ) ,
271
271
(unsigned )commit_idx_pos );
272
272
273
273
bitmap = read_bitmap_1 (index );
274
274
if (!bitmap )
275
275
return -1 ;
276
276
277
277
if (xor_offset > MAX_XOR_OFFSET || xor_offset > i )
278
- return error ("corrupted bitmap pack index" );
278
+ return error (_ ( "corrupted bitmap pack index" ) );
279
279
280
280
if (xor_offset > 0 ) {
281
281
xor_bitmap = recent_bitmaps [(i - xor_offset ) % MAX_XOR_OFFSET ];
282
282
283
283
if (xor_bitmap == NULL )
284
- return error ("invalid XOR offset in bitmap pack index" );
284
+ return error (_ ( "invalid XOR offset in bitmap pack index" ) );
285
285
}
286
286
287
287
recent_bitmaps [i % MAX_XOR_OFFSET ] = store_bitmap (
@@ -331,7 +331,7 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
331
331
struct strbuf buf = STRBUF_INIT ;
332
332
get_midx_filename (& buf , midx -> object_dir );
333
333
/* ignore extra bitmap file; we can only handle one */
334
- warning ("ignoring extra bitmap file: '%s'" , buf .buf );
334
+ warning (_ ( "ignoring extra bitmap file: '%s'" ) , buf .buf );
335
335
close (fd );
336
336
strbuf_release (& buf );
337
337
return -1 ;
@@ -388,7 +388,7 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
388
388
389
389
if (bitmap_git -> pack || bitmap_git -> midx ) {
390
390
/* ignore extra bitmap file; we can only handle one */
391
- warning ("ignoring extra bitmap file: '%s'" , packfile -> pack_name );
391
+ warning (_ ( "ignoring extra bitmap file: '%s'" ) , packfile -> pack_name );
392
392
close (fd );
393
393
return -1 ;
394
394
}
@@ -818,7 +818,7 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
818
818
revs -> include_check_data = & incdata ;
819
819
820
820
if (prepare_revision_walk (revs ))
821
- die ("revision walk setup failed" );
821
+ die (_ ( "revision walk setup failed" ) );
822
822
823
823
show_data .bitmap_git = bitmap_git ;
824
824
show_data .base = base ;
@@ -1627,15 +1627,15 @@ static void test_bitmap_type(struct bitmap_test_data *tdata,
1627
1627
}
1628
1628
1629
1629
if (bitmap_type == OBJ_NONE )
1630
- die ("object '%s' not found in type bitmaps" ,
1630
+ die (_ ( "object '%s' not found in type bitmaps" ) ,
1631
1631
oid_to_hex (& obj -> oid ));
1632
1632
1633
1633
if (bitmaps_nr > 1 )
1634
- die ("object '%s' does not have a unique type" ,
1634
+ die (_ ( "object '%s' does not have a unique type" ) ,
1635
1635
oid_to_hex (& obj -> oid ));
1636
1636
1637
1637
if (bitmap_type != obj -> type )
1638
- die ("object '%s': real type '%s', expected: '%s'" ,
1638
+ die (_ ( "object '%s': real type '%s', expected: '%s'" ) ,
1639
1639
oid_to_hex (& obj -> oid ),
1640
1640
type_name (obj -> type ),
1641
1641
type_name (bitmap_type ));
@@ -1649,7 +1649,7 @@ static void test_show_object(struct object *object, const char *name,
1649
1649
1650
1650
bitmap_pos = bitmap_position (tdata -> bitmap_git , & object -> oid );
1651
1651
if (bitmap_pos < 0 )
1652
- die ("object not in bitmap: '%s'" , oid_to_hex (& object -> oid ));
1652
+ die (_ ( "object not in bitmap: '%s'" ) , oid_to_hex (& object -> oid ));
1653
1653
test_bitmap_type (tdata , object , bitmap_pos );
1654
1654
1655
1655
bitmap_set (tdata -> base , bitmap_pos );
@@ -1664,7 +1664,7 @@ static void test_show_commit(struct commit *commit, void *data)
1664
1664
bitmap_pos = bitmap_position (tdata -> bitmap_git ,
1665
1665
& commit -> object .oid );
1666
1666
if (bitmap_pos < 0 )
1667
- die ("object not in bitmap: '%s'" , oid_to_hex (& commit -> object .oid ));
1667
+ die (_ ( "object not in bitmap: '%s'" ) , oid_to_hex (& commit -> object .oid ));
1668
1668
test_bitmap_type (tdata , & commit -> object , bitmap_pos );
1669
1669
1670
1670
bitmap_set (tdata -> base , bitmap_pos );
@@ -1681,10 +1681,10 @@ void test_bitmap_walk(struct rev_info *revs)
1681
1681
struct ewah_bitmap * bm ;
1682
1682
1683
1683
if (!(bitmap_git = prepare_bitmap_git (revs -> repo )))
1684
- die ("failed to load bitmap indexes" );
1684
+ die (_ ( "failed to load bitmap indexes" ) );
1685
1685
1686
1686
if (revs -> pending .nr != 1 )
1687
- die ("you must specify exactly one commit to test" );
1687
+ die (_ ( "you must specify exactly one commit to test" ) );
1688
1688
1689
1689
fprintf_ln (stderr , "Bitmap v%d test (%d entries loaded)" ,
1690
1690
bitmap_git -> version , bitmap_git -> entry_count );
@@ -1700,7 +1700,7 @@ void test_bitmap_walk(struct rev_info *revs)
1700
1700
}
1701
1701
1702
1702
if (result == NULL )
1703
- die ("commit '%s' doesn't have an indexed bitmap" , oid_to_hex (& root -> oid ));
1703
+ die (_ ( "commit '%s' doesn't have an indexed bitmap" ) , oid_to_hex (& root -> oid ));
1704
1704
1705
1705
revs -> tag_objects = 1 ;
1706
1706
revs -> tree_objects = 1 ;
@@ -1709,7 +1709,7 @@ void test_bitmap_walk(struct rev_info *revs)
1709
1709
result_popcnt = bitmap_popcount (result );
1710
1710
1711
1711
if (prepare_revision_walk (revs ))
1712
- die ("revision walk setup failed" );
1712
+ die (_ ( "revision walk setup failed" ) );
1713
1713
1714
1714
tdata .bitmap_git = bitmap_git ;
1715
1715
tdata .base = bitmap_new ();
@@ -1727,7 +1727,7 @@ void test_bitmap_walk(struct rev_info *revs)
1727
1727
if (bitmap_equals (result , tdata .base ))
1728
1728
fprintf_ln (stderr , "OK!" );
1729
1729
else
1730
- die ("mismatch in bitmap results" );
1730
+ die (_ ( "mismatch in bitmap results" ) );
1731
1731
1732
1732
bitmap_free (result );
1733
1733
bitmap_free (tdata .base );
@@ -1745,7 +1745,7 @@ int test_bitmap_commits(struct repository *r)
1745
1745
MAYBE_UNUSED void * value ;
1746
1746
1747
1747
if (!bitmap_git )
1748
- die ("failed to load bitmap indexes" );
1748
+ die (_ ( "failed to load bitmap indexes" ) );
1749
1749
1750
1750
kh_foreach (bitmap_git -> bitmaps , oid , value , {
1751
1751
printf_ln ("%s" , oid_to_hex (& oid ));
0 commit comments