Open
Description
If a repository/odb has an alternates file, we follow it to grab objects from other repositories. But we don't have any way of interacting with it from a program.
It is "just" a newline-delimited list of paths in a file so we might not necessarily want to do too much in libgit2, but maybe it can be abstracted just enough so non-default backends can also make use of it.
So I was thinking of maybe having
git_odb_alternates_read(git_strarray*, git_odb *);
git_odb_alternates_write(git_odb *, git_strarray *);
git_odb_alternates_append(git_odb *, const char *);
with the appropriate additions to the odb backend interface, which should make implementing things like git clone --reference
or --shared
that much easier.