Skip to content

Commit e020391

Browse files
peffgitster
authored andcommitted
commit-graph: mark chunk error messages for translation
The patches from f32af12 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f4e4756 commit e020391

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

commit-graph.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int graph_read_oid_fanout(const unsigned char *chunk_start,
282282
int i;
283283

284284
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"));
286286
g->chunk_oid_fanout = (const uint32_t *)chunk_start;
287287
g->num_commits = ntohl(g->chunk_oid_fanout[255]);
288288

@@ -291,7 +291,7 @@ static int graph_read_oid_fanout(const unsigned char *chunk_start,
291291
uint32_t oid_fanout2 = ntohl(g->chunk_oid_fanout[i + 1]);
292292

293293
if (oid_fanout1 > oid_fanout2) {
294-
error("commit-graph fanout values out of order");
294+
error(_("commit-graph fanout values out of order"));
295295
return 1;
296296
}
297297
}
@@ -314,7 +314,7 @@ static int graph_read_commit_data(const unsigned char *chunk_start,
314314
{
315315
struct commit_graph *g = data;
316316
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"));
318318
g->chunk_commit_data = chunk_start;
319319
return 0;
320320
}
@@ -324,7 +324,7 @@ static int graph_read_generation_data(const unsigned char *chunk_start,
324324
{
325325
struct commit_graph *g = data;
326326
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"));
328328
g->chunk_generation_data = chunk_start;
329329
return 0;
330330
}
@@ -334,7 +334,7 @@ static int graph_read_bloom_index(const unsigned char *chunk_start,
334334
{
335335
struct commit_graph *g = data;
336336
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"));
338338
return -1;
339339
}
340340
g->chunk_bloom_indexes = chunk_start;
@@ -348,8 +348,8 @@ static int graph_read_bloom_data(const unsigned char *chunk_start,
348348
uint32_t hash_version;
349349

350350
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"),
353353
(uintmax_t)chunk_size,
354354
(uintmax_t)BLOOMDATA_CHUNK_HEADER_SIZE);
355355
return -1;
@@ -605,7 +605,7 @@ int open_commit_graph_chain(const char *chain_file,
605605
/* treat empty files the same as missing */
606606
errno = ENOENT;
607607
} else {
608-
warning("commit-graph chain file too small");
608+
warning(_("commit-graph chain file too small"));
609609
errno = EINVAL;
610610
}
611611
return 0;
@@ -953,7 +953,7 @@ static int fill_commit_in_graph(struct repository *r,
953953
parent_data_pos = edge_value & GRAPH_EDGE_LAST_MASK;
954954
do {
955955
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"));
957957
free_commit_list(item->parents);
958958
item->parents = NULL;
959959
item->object.parsed = 0;

0 commit comments

Comments
 (0)