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>