An instance for a custom backend
Write an object into the backend. The id of the object has already been calculated and is passed in.
If the backend implements a refreshing mechanism, it should be exposed through this endpoint. Each call to git_odb_refresh()
will invoke it.
However, the backend implementation should try to stay up-to-date as much as possible by itself as libgit2 will not automatically invoke git_odb_refresh()
. For instance, a potential strategy for the backend implementation to achieve this could be to internally invoke this endpoint on failed lookups (ie. exists()
, read()
, read_header()
).
"Freshens" an already existing object, updating its last-used time. This occurs when git_odb_write
was called, but the object already existed (and will not be re-written). The underlying implementation may want to update last-used timestamps.
If callers implement this, they should return 0
if the object exists and was freshened, and non-zero otherwise.
Frees any resources held by the odb (including the git_odb_backend
itself). An odb backend implementation must provide this function.