]> arthur.barton.de Git - bup.git/commit
ls: read metadata only if needed
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 5 Feb 2020 21:24:01 +0000 (22:24 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 30 May 2021 17:17:50 +0000 (12:17 -0500)
commit73e996bc79d3693eadad405dda7c7b55a8f7fad9
treeef4fdc4091762d2f16b3b503e254d7af470b7751
parent2fa6ddcd2ee6843f80718010f066be50a252a925
ls: read metadata only if needed

If we just want to get a list of files, there's no point in
reading metadata, since it simply isn't needed. Pass want_meta
to the appropriate functions only when we need the metadata,
and similarly call vfs.augment_item_meta() only then.

Note that the previous vfs change really made this effective,
we'd otherwise lose the information.

Note also that unfortunately this is necessary even for the
--file-type command line option because otherwise we cannot
identify FIFOs; for everything else the git mode appears to
be sufficient.

Together, this reduces the number of blob reads from 62 to 8
for 'bup ls' on a trivial folder (the bup git's root folder).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/ls.py