]> arthur.barton.de Git - bup.git/commit
git.cp(): don't repeatedly recompute default repo 0.29-rc1
authorRob Browning <rlb@defaultvalue.org>
Sat, 17 Dec 2016 20:40:02 +0000 (14:40 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 17 Dec 2016 20:40:04 +0000 (14:40 -0600)
commit53db6ee308661b43ee738443e0be23b1485c99be
tree04f05874a09ef4a1427a6db64ceddac32c88f7de
parent519b7cbcb8a87d02620322144e486b2524e417f6
git.cp(): don't repeatedly recompute default repo

Before, bup would end up calling repo() for every invocation of cp().
Given that constructions like cp().get(id) are common, this could cause
a lot of unecessary calls, given that we already have git.repodir, which
will have the relevant value once initialized.

Discovered after noticing "bup restore" was hammering
"$BUP_DIR"/.git (which didn't exist).

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