commit-graph: mark chunk error messages for translation
The patches from f32af12cee (Merge branch 'jk/chunk-bounds', 2023-10-23) added many new untranslated error messages. While it's unlikely for most users to see these messages at all, most of the other commit-graph error messages are translated (and likewise for the matching midx messages). Let's mark them all for consistency (and to help any poor unfortunate user who does manage to find a broken graph file). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Nov 9, 2023 at 02:26 UTC
e02039167371a842a12cc571582c089c287e7233
1 file changed
+9
-9
commit-graph.c
+9
-9
@@ -282,7 +282,7 @@ static int graph_read_oid_fanout(const unsigned char *chunk_start,
282
int i;
283
284
if (chunk_size != 256 * sizeof(uint32_t))
285
- return error("commit-graph oid fanout chunk is wrong size");
285
+ return error(_("commit-graph oid fanout chunk is wrong size"));
286
g->chunk_oid_fanout = (const uint32_t *)chunk_start;
287
g->num_commits = ntohl(g->chunk_oid_fanout[255]);
288
@@ -291,7 +291,7 @@ static int graph_read_oid_fanout(const unsigned char *chunk_start,
291
uint32_t oid_fanout2 = ntohl(g->chunk_oid_fanout[i + 1]);
292
293
if (oid_fanout1 > oid_fanout2) {
294
- error("commit-graph fanout values out of order");
294
+ error(_("commit-graph fanout values out of order"));
295
return 1;
296
}
297
}
@@ -314,7 +314,7 @@ static int graph_read_commit_data(const unsigned char *chunk_start,
314
{
315
struct commit_graph *g = data;
316
if (chunk_size / GRAPH_DATA_WIDTH != g->num_commits)
317
- return error("commit-graph commit data chunk is wrong size");
317
+ return error(_("commit-graph commit data chunk is wrong size"));
318
g->chunk_commit_data = chunk_start;
319
return 0;
320
}
@@ -324,7 +324,7 @@ static int graph_read_generation_data(const unsigned char *chunk_start,
324
{
325
struct commit_graph *g = data;
326
if (chunk_size / sizeof(uint32_t) != g->num_commits)
327
- return error("commit-graph generations chunk is wrong size");
327
+ return error(_("commit-graph generations chunk is wrong size"));
328
g->chunk_generation_data = chunk_start;
329
return 0;
330
}
@@ -334,7 +334,7 @@ static int graph_read_bloom_index(const unsigned char *chunk_start,
334
{
335
struct commit_graph *g = data;
336
if (chunk_size / 4 != g->num_commits) {
337
- warning("commit-graph changed-path index chunk is too small");
337
+ warning(_("commit-graph changed-path index chunk is too small"));
338
return -1;
339
}
340
g->chunk_bloom_indexes = chunk_start;
@@ -348,8 +348,8 @@ static int graph_read_bloom_data(const unsigned char *chunk_start,
348
uint32_t hash_version;
349
350
if (chunk_size < BLOOMDATA_CHUNK_HEADER_SIZE) {
351
- warning("ignoring too-small changed-path chunk"
352
- " (%"PRIuMAX" < %"PRIuMAX") in commit-graph file",
351
+ warning(_("ignoring too-small changed-path chunk"
352
+ " (%"PRIuMAX" < %"PRIuMAX") in commit-graph file"),
353
(uintmax_t)chunk_size,
354
(uintmax_t)BLOOMDATA_CHUNK_HEADER_SIZE);
355
return -1;
@@ -605,7 +605,7 @@ int open_commit_graph_chain(const char *chain_file,
605
/* treat empty files the same as missing */
606
errno = ENOENT;
607
} else {
608
- warning("commit-graph chain file too small");
608
+ warning(_("commit-graph chain file too small"));
609
errno = EINVAL;
610
}
611
return 0;
@@ -953,7 +953,7 @@ static int fill_commit_in_graph(struct repository *r,
953
parent_data_pos = edge_value & GRAPH_EDGE_LAST_MASK;
954
do {
955
if (g->chunk_extra_edges_size / sizeof(uint32_t) <= parent_data_pos) {
956
- error("commit-graph extra-edges pointer out of bounds");
956
+ error(_("commit-graph extra-edges pointer out of bounds"));
957
free_commit_list(item->parents);
958
item->parents = NULL;
959
item->object.parsed = 0;