git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] archive: fix misleading error message

From
René Scharfe <l.s.r@web.de>
Date
Oct 3, 2024, 15:51 UTC
Message-ID
<faed1d0e-86a8-4dcd-a27f-19dcd9f89f37@web.de>

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>
---
Silly me, I stole the wrong message. :-/
 archive.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/archive.c b/archive.c
index 58f86bf75c..a7a92ff839 100644
--- a/archive.c
+++ b/archive.c
@@ -536,7 +536,8 @@ static void parse_treeish_arg(const char **argv,
 		opts.fn = oneway_merge;
 		init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
 		if (unpack_trees(1, &t, &opts))
-			die(_("unable to checkout working tree"));
+			die(_("failed to unpack tree object %s"),
+			    oid_to_hex(&tree->object.oid));

 		git_attr_set_direction(GIT_ATTR_INDEX);
 	}
--
2.46.2
Next: Martin Ågren
Message 1 of 2 in “archive: fix misleading error message”
  1. archive: fix misleading error messageRené Scharfe, Oct 3, 2024
  2. Martin ÅgrenOct 4, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.