From: SZEDER Gábor Date: Thu, 28 Jun 2018 22:28:00 GMT Subject: Re: [PATCH v5 3/8] block alloc: add lifecycle APIs for cache_entry structs Message-ID: <20180628222800.10570-1-szeder.dev@gmail.com> In-Reply-To: <20180628135932.225288-4-jamill@microsoft.com> > diff --git a/read-cache.c b/read-cache.c > index 9624ce1784..116fd51680 100644 > --- a/read-cache.c > +++ b/read-cache.c > +struct cache_entry *make_transient_cache_entry(unsigned int mode, const struct object_id *oid, > + const char *path, int stage) > +{ > + struct cache_entry *ce; > + int len; > + > + if (!verify_path(path, mode)) { > + error("Invalid path '%s'", path); > + return NULL; > + } > + > + len = strlen(path); > + ce = make_empty_transient_cache_entry(len); > + > + hashcpy(ce->oid.hash, oid->hash); Please use oidcpy() here, too.