{"thread":{"id":"62247","subject":"[PATCH] archive: fix misleading error message","startedAt":"2024-10-03T15:51:07Z","lastAt":"2024-10-04T10:07:50Z","messageCount":2,"participants":["René Scharfe","Martin Ågren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"504028","messageId":"faed1d0e-86a8-4dcd-a27f-19dcd9f89f37@web.de","threadId":"62247","inReplyTo":null,"subject":"[PATCH] archive: fix misleading error message","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2024-10-03T15:51:01Z","receivedAt":"2024-10-03T15:51:07Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The error message added by 296743a7ca (archive: load index before\npathspec checks, 2024-09-21) is misleading: unpack_trees() is not\ntouching the working tree at all here, but just loading a tree into\nthe index.  Correct it.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nSilly me, I stole the wrong message. :-/\n\n archive.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/archive.c b/archive.c\nindex 58f86bf75c..a7a92ff839 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -536,7 +536,8 @@ static void parse_treeish_arg(const char **argv,\n \t\topts.fn = oneway_merge;\n \t\tinit_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);\n \t\tif (unpack_trees(1, &t, &opts))\n-\t\t\tdie(_(\"unable to checkout working tree\"));\n+\t\t\tdie(_(\"failed to unpack tree object %s\"),\n+\t\t\t    oid_to_hex(&tree->object.oid));\n\n \t\tgit_attr_set_direction(GIT_ATTR_INDEX);\n \t}\n--\n2.46.2\n"},{"id":"504079","messageId":"CAN0heSoN-iEdzj1BTw6eRDvRzLkK_oXdSwaG=hxeZUQiYvWZUg@mail.gmail.com","threadId":"62247","inReplyTo":"faed1d0e-86a8-4dcd-a27f-19dcd9f89f37@web.de","subject":"Re: [PATCH] archive: fix misleading error message","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2024-10-04T10:07:35Z","receivedAt":"2024-10-04T10:07:50Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Thu, 3 Oct 2024 at 17:51, René Scharfe <l.s.r@web.de> wrote:\n>\n> The error message added by 296743a7ca (archive: load index before\n> pathspec checks, 2024-09-21) is misleading: unpack_trees() is not\n> touching the working tree at all here, but just loading a tree into\n> the index.  Correct it.\n\n>                 init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);\n>                 if (unpack_trees(1, &t, &opts))\n> -                       die(_(\"unable to checkout working tree\"));\n> +                       die(_(\"failed to unpack tree object %s\"),\n> +                           oid_to_hex(&tree->object.oid));\n\nThe existing instance of this message isn't translated, so it'll still\nbe a new string to translate. Anyway, it's good to use the same wording\nhere as elsewhere.\n\nThere's also a \"failed to unpack trees\", but here, we're indeed\nunpacking *one* tree.\n\nGood catch!\n\nMartin\n"}]}