Skip to content

Commit 93d2924

Browse files
peffgitster
authored andcommitted
commit-graph: clarify missing-chunk error messages
When a required commit-graph chunk cannot be loaded, we leave its entry in the struct NULL, and then later complain that it is missing. But that's just one reason we might not have loaded it, as we also do some data quality checks. Let's switch these messages to say "missing or corrupted", which is exactly what the midx code says for the same cases. Likewise, we'll use the same phrasing and capitalization as those for consistency. And while we're here, we can mark them for translation (just like the midx ones). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92de4c5 commit 93d2924

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

commit-graph.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ static int verify_commit_graph_lite(struct commit_graph *g)
292292
* itself.
293293
*/
294294
if (!g->chunk_oid_fanout) {
295-
error("commit-graph is missing the OID Fanout chunk");
295+
error(_("commit-graph required OID fanout chunk missing or corrupted"));
296296
return 1;
297297
}
298298
if (!g->chunk_oid_lookup) {
299-
error("commit-graph is missing the OID Lookup chunk");
299+
error(_("commit-graph required OID lookup chunk missing or corrupted"));
300300
return 1;
301301
}
302302
if (!g->chunk_commit_data) {
303-
error("commit-graph is missing the Commit Data chunk");
303+
error(_("commit-graph required commit data chunk missing or corrupted"));
304304
return 1;
305305
}
306306

t/t5318-commit-graph.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,17 +540,17 @@ test_expect_success 'detect low chunk count' '
540540

541541
test_expect_success 'detect missing OID fanout chunk' '
542542
corrupt_graph_and_verify $GRAPH_BYTE_OID_FANOUT_ID "\0" \
543-
"missing the OID Fanout chunk"
543+
"commit-graph required OID fanout chunk missing or corrupted"
544544
'
545545

546546
test_expect_success 'detect missing OID lookup chunk' '
547547
corrupt_graph_and_verify $GRAPH_BYTE_OID_LOOKUP_ID "\0" \
548-
"missing the OID Lookup chunk"
548+
"commit-graph required OID lookup chunk missing or corrupted"
549549
'
550550

551551
test_expect_success 'detect missing commit data chunk' '
552552
corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_DATA_ID "\0" \
553-
"missing the Commit Data chunk"
553+
"commit-graph required commit data chunk missing or corrupted"
554554
'
555555

556556
test_expect_success 'detect incorrect fanout' '
@@ -842,7 +842,7 @@ test_expect_success 'reader notices too-small oid fanout chunk' '
842842
check_corrupt_chunk OIDF clear $(printf "000000%02x" $(test_seq 250)) &&
843843
cat >expect.err <<-\EOF &&
844844
error: commit-graph oid fanout chunk is wrong size
845-
error: commit-graph is missing the OID Fanout chunk
845+
error: commit-graph required OID fanout chunk missing or corrupted
846846
EOF
847847
test_cmp expect.err err
848848
'
@@ -874,7 +874,7 @@ test_expect_success 'reader notices too-small commit data chunk' '
874874
check_corrupt_chunk CDAT clear 00000000 &&
875875
cat >expect.err <<-\EOF &&
876876
error: commit-graph commit data chunk is wrong size
877-
error: commit-graph is missing the Commit Data chunk
877+
error: commit-graph required commit data chunk missing or corrupted
878878
EOF
879879
test_cmp expect.err err
880880
'

0 commit comments

Comments
 (0)