aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2024-02-23 08:34:25 +0000
committerJunio C Hamano <gitster@pobox.com>2024-02-23 10:19:40 -0800
commit342990c7aaef5ac645e89101cb84569caf64baf4 (patch)
treedf4022c10e04e5edca64d3c2bea336d481c81630
parent5aca024a74e900bd9bc2c14a8e99494063ea4cc5 (diff)
downloadgit-342990c7aaef5ac645e89101cb84569caf64baf4.tar.gz
fill_tree_descriptor(): mark error message for translation
There is an error message in that function to report a missing tree; In contrast to three other, similar error messages, it is not marked for translation yet. Mark it for translation, and while at it, make the error message consistent with the others by enclosing the SHA in parentheses. This requires a change to t6030 which expects the previous format of the commit message. Theoretically, this could present problems with existing scripts that use `git bisect` and parse its output (because Git does not provide other means for callers to discern between error conditions). However, this is unlikely to matter in practice because the most common course of action to deal with fatal corruptions is to report the error message to the user and exit, rather than trying to do something with the reported SHA of the missing tree. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t6030-bisect-porcelain.sh2
-rw-r--r--tree-walk.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 2a5b7d8379..58f3d9c675 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -872,7 +872,7 @@ test_expect_success 'broken branch creation' '
echo "" > expected.ok
cat > expected.missing-tree.default <<EOF
-fatal: unable to read tree $deleted
+fatal: unable to read tree ($deleted)
EOF
test_expect_success 'bisect fails if tree is broken on start commit' '
diff --git a/tree-walk.c b/tree-walk.c
index b517792ba2..690fa6569b 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -100,7 +100,7 @@ void *fill_tree_descriptor(struct repository *r,
if (oid) {
buf = read_object_with_reference(r, oid, OBJ_TREE, &size, NULL);
if (!buf)
- die("unable to read tree %s", oid_to_hex(oid));
+ die(_("unable to read tree (%s)"), oid_to_hex(oid));
}
init_tree_desc(desc, buf, size);
return buf;