On Mon, Nov 12, 2018 at 11:04:52AM -0800, Stefan Beller wrote: > > for (odb = the_repository->objects->odb; odb; odb = odb->next) { > > if (odb->local) > > return odb->path; > > } > > return NULL; /* yikes? */ > > > > ? That feels like it's making things more complicated, not less. > > It depends if the caller cares about the local flag. > > I'd think we can have more than one local, eventually? > Just think of the partial clone stuff that may have a local > set of promised stuff and another set of actual objects, > which may be stored in different local odbs. Yeah, but I think the definition of "local" gets very tricky there, and we'll have to think about what it means. So I'd actually prefer to punt on doing anything too clever at this point. > If the caller cares about the distinction, they would need > to write out this loop as above themselves. > If they don't care, we could migrate them to not > use this function, so we can get rid of it? Yes, I do think in the long run we'd want to get rid of most calls to get_object_directory(). Not only because it uses the_repository, but because most callers should be asking for a specific action: I want to write an object, or I want to read an object. -Peff