archive: fix misleading error message

The error message added by 296743a7ca (archive: load index before pathspec checks, 2024-09-21) is misleading: unpack_trees() is not touching the working tree at all here, but just loading a tree into the index. Correct it. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Oct 3, 2024 at 17:51 UTC bebf0e248775146cac0b9eee22ed9d75848d636f
1 file changed +2 -1
archive.c
+2 -1
@@ -536,7 +536,8 @@ static void parse_treeish_arg(const char **argv,
536 opts.fn = oneway_merge;
537 init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
538 if (unpack_trees(1, &t, &opts))
539 - die(_("unable to checkout working tree"));
539 + die(_("failed to unpack tree object %s"),
540 + oid_to_hex(&tree->object.oid));
541
542 git_attr_set_direction(GIT_ATTR_INDEX);
543 }