If _commit_item_from_oid() is called first with require_meta=False,
and then again with require_meta=True, the second and further calls
will not use the cache, as the cached entry is without metadata.
Improve this by overwriting the cache entry if it couldn't be used.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
if meta:
commit = commit._replace(meta=meta)
commit_key = b'itm:' + oid
- cache_notice(commit_key, commit)
+ cache_notice(commit_key, commit, overwrite=True)
return commit
def _revlist_item_from_oid(repo, oid, require_meta):