git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gareth Hayes" <gareth.hayes@bitcoin.org.hk>
To: git@vger.kernel.org
Subject: Problem: `fatal: too-short tree object` when executing hash-object on tree
Date: Thu, 31 Aug 2023 18:58:30 +0800	[thread overview]
Message-ID: <0de414f8-f409-467f-a504-06a78f088981@app.fastmail.com> (raw)

Problem: I'm trying to reproduce the identifier of a tree object using `git cat-file -p <tree object identifier> | git hash-object -t tree --stdin`

This results in an error:
`fatal: too-short tree object`

To replicate: 
`git cat-file -p HEAD`
`git cat-file -p <tree object identifier from output of above> | git hash-object -t tree --stdin`

This works for other object types but not trees. What am I doing wrong?

             reply	other threads:[~2023-08-31 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 10:58 Gareth Hayes [this message]
2023-08-31 17:10 ` Problem: `fatal: too-short tree object` when executing hash-object on tree Johannes Sixt
2023-08-31 17:25 ` Junio C Hamano

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=0de414f8-f409-467f-a504-06a78f088981@app.fastmail.com \
    --to=gareth.hayes@bitcoin.org.hk \
    --cc=git@vger.kernel.org \
    /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).