]> arthur.barton.de Git - bup.git/commit
walk_object: ignore blob content if not requested
authorBen Kelly <bk@ancilla.ca>
Thu, 10 Nov 2016 15:01:08 +0000 (10:01 -0500)
committerRob Browning <rlb@defaultvalue.org>
Wed, 23 Nov 2016 18:39:25 +0000 (12:39 -0600)
commit5c4ffaca2f2a2f2b60d16a9253ffdbeaac16cea7
tree181bd3b2dcc3d2fe162b5705d453d0f6541f77c3
parentdb580dd7b402f31a2b18e1e1ee261fedc57b0d4a
walk_object: ignore blob content if not requested

Previously, walk_object would read the contents of each object it
encountered, even if it subsequently threw away those contents.

With this change, it will skip reading the contents of blobs unless
the caller explicitly asked for blob contents. In particular, this
means operations that traverse the object graph without caring
about object contents, such as `bup gc`, now only need to read the
contents of tree and commit objects.

Tested: `make test`; local run against copy of production repo.
Signed-off-by: Ben Kelly <btk@google.com>
[rlb@defaultvalue.org: shorten commit summary; adjust indentation;
 adjust docstring and comment; test "not include_data" first; change to
 type='blob']

Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py