Problem: `fatal: too-short tree object` when executing hash-object on tree
- From
- Gareth Hayes <gareth.hayes@bitcoin.org.hk>
- Date
- Aug 31, 2023, 10:58 UTC
- Message-ID
- <0de414f8-f409-467f-a504-06a78f088981@app.fastmail.com>
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?