]> arthur.barton.de Git - bup.git/commit
client: fix index-cache location when there's no path
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 22 Jan 2020 08:25:40 +0000 (09:25 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 2 Feb 2020 18:14:27 +0000 (12:14 -0600)
commit4f2ee35cbc793f77f0b2f9ed3303701dba1903ee
treec46c50de6d8d8d963c08c6a48b4da73a6b83fc30
parent975d9ce1004abd08cd81dd84cc37ecb590de50b7
client: fix index-cache location when there's no path

Putting my current tree into production, I noticed that the
index-cache was completely re-downloaded (taking a long time)
due to a change in storage location, which was broken in the
commit 85edc0f1c133 ("bup.client: accommodate python 3").

The "self.dir or b'None'" was in commit 85edc0f1c133
("bup.client: accommodate python 3") was clearly well-intended,
but also had the effect of transforming the empty string (which
evaluates to False) to b'None' instead, which is wrong since in
'bup on' cases there's no dir, but parse_remote() comes up with
an empty string instead of None.

Fix that and add a test that checks that the index location
without a dir is actually preserved as such.

Fixes: 85edc0f1c133 ("bup.client: accommodate python 3")
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/client.py
t/test-on.sh