git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] archive: fix misleading error message
Date: Thu, 3 Oct 2024 17:51:01 +0200	[thread overview]
Message-ID: <faed1d0e-86a8-4dcd-a27f-19dcd9f89f37@web.de> (raw)

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

             reply	other threads:[~2024-10-03 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 15:51 René Scharfe [this message]
2024-10-04 10:07 ` [PATCH] archive: fix misleading error message Martin Ågren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faed1d0e-86a8-4dcd-a27f-19dcd9f89f37@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).