X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=blobdiff_plain;f=lib%2Fbup%2Fvfs.py;h=541a28f3b4849a8741c1ede4cd0a992731a19b83;hp=e68b60cc4e0a42a66e709224f598d1d567bb41b5;hb=2fcbc19217eef1dd8492c0a4429cc2b22339ec9a;hpb=c6fdb2298c5cbcc6f1d11aec6a6c091efee74be9 diff --git a/lib/bup/vfs.py b/lib/bup/vfs.py index e68b60c..541a28f 100644 --- a/lib/bup/vfs.py +++ b/lib/bup/vfs.py @@ -829,12 +829,14 @@ def tags_items(repo, names): def tag_item(oid): assert len(oid) == 20 + cached = cache_get_commit_item(oid, need_meta=False) + if cached: + return cached oidx = hexlify(oid) it = repo.cat(oidx) _, typ, size = next(it) if typ == b'commit': - return cache_get_commit_item(oid, need_meta=False) \ - or _commit_item_from_data(oid, b''.join(it)) + return _commit_item_from_data(oid, b''.join(it)) for _ in it: pass if typ == b'blob': return Item(meta=default_file_mode, oid=oid)