Re: [PATCH v5 2/2] attr: add flag `--source` to work with tree-ish
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jan 14, 2023, 08:26 UTC
- Message-ID
- <CAOLa=ZQdNy-gQ0-gUdQM8z+k0fpLjXcRY3fAC4v2PnEvSRS2PQ@mail.gmail.com>
- In-Reply-To
- <230112.86lem728ig.gmgdl@evledraar.gmail.com>
On Thu, Jan 12, 2023 at 2:21 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 24 quoted lines
>
>
> On Mon, Jan 02 2023, Karthik Nayak wrote:
>
> > +static struct attr_stack *read_attr_from_blob(struct index_state *istate,
> > + const struct object_id *tree_oid,
> > + const char *path, unsigned flags)
> > +{
> > + struct object_id oid;
> > + unsigned long sz;
> > + enum object_type type;
> > + void *buf;
> > + unsigned short mode;
> > +
> > + if (!tree_oid)
> > + return NULL;
> > +
> > + if (get_tree_entry(istate->repo, tree_oid, path, &oid, &mode))
> > + return NULL;
> > +
> > + buf = read_object_file(&oid, &type, &sz);
>
> Here you flip-flop between istate->repo and "the_repository". I think
> you want to use repo_read_object_file(istate->repo, ...) instead.Let me add this to v7! Thanks