On Fri, Jan 03, 2020 at 04:13:31PM -0800, Jonathan Nieder wrote: > To follow up on Junio's hint in his review: callers can inject > additional cached objects by using pretend_object_file. Junio > described how this would make sense as a mechanism for building > the virtual ancestor object, but we don't do that. In fact, the > only caller is fake_working_tree_commit in "git blame", a read-only > code path. *phew* > > -- >8 -- > Subject: sha1-file: document how to use pretend_object_file > [...] > +/* > + * Add an object file to the in-memory object store, without writing it > + * to disk. > + * > + * Callers are responsible for calling write_object_file to record the > + * object in persistent storage before writing any other new objects > + * that reference it. > + */ > int pretend_object_file(void *, unsigned long, enum object_type, > struct object_id *oid); > I think this is an improvement over the status quo, but it's still a potential trap for code which happens to run in the same process (see my other email in the thread). Should the message perhaps be even more scary? -Peff