Re: [PATCH v5 2/2] attr: add flag `--source` to work with tree-ish
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jan 12, 2023, 13:20 UTC
- Message-ID
- <230112.86lem728ig.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <23813496fc73b7e5cb9f09b166e05c9a02bac43c.1671793109.git.karthik.188@gmail.com>
On Mon, Jan 02 2023, Karthik Nayak wrote:
Show 17 quoted lines
> +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.