Re: git read-tree doesn't accept tree-ish
- From
Jeff King <peff@peff.net>
- Date
- Aug 23, 2021, 18:53 UTC
- Message-ID
- <YSPuq/HmF3tnYHCA@coredump.intra.peff.net>
- In-Reply-To
- <CAMJzOtxMjEuAy2B3oJqOZEnipmC4OBWxhQLx_baXDHcQ1C7-+g@mail.gmail.com>
On Mon, Aug 23, 2021 at 07:31:29PM +0200, Nikita Bobko wrote:
Show 17 quoted lines
> ``` > git init > echo foo > foo > git add --all > git commit -m 'foo' > > echo bar > foo > git add --all > git commit -m 'bar' > > git read-tree HEAD~:foo > ``` > EXP: Read information about file `foo` into index > ACT: `fatal: failed to unpack tree object HEAD~:foo` > > I expect it to work because manpage says that `git-read-tree` accepts > `<tree-ish>`
In your example, "foo" is a blob, not a tree. And thus HEAD~:foo is not a tree-ish. Just "HEAD~" would be.
What are you trying to do?
-Peff