]> arthur.barton.de Git - bup.git/commit
index: always return at least the root for filter prefixes
authorRob Browning <rlb@defaultvalue.org>
Mon, 21 Dec 2015 19:35:24 +0000 (13:35 -0600)
committerRob Browning <rlb@defaultvalue.org>
Mon, 22 Feb 2016 00:16:10 +0000 (18:16 -0600)
commitc6ca14bac1e848d9414841d7181b7c7cdc85caa2
treed1378cb749d45546f15be74eb13e6e236be600d6
parent7fdfad135587067d4fc0ff9fbc9d708497542b9c
index: always return at least the root for filter prefixes

Return at least an entry for the prefix itself for each prefix passed
to filter.  Otherwise something like "bup save ... x/y" will fail when
x is up to date because filter will return nothing, save will traverse
nothing in its main loop, and bup will crash with an assertion
failure:

  File "/home/rlb/src/bup/main/cmd/bup-save", line 440, in <module>
    assert(len(shalists) == 1)

Instead "bup save ... x/y" should (and now will) produce a new save
containing x/y.

Thanks to Simon Persson for helping formulate a good test case.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Makefile
lib/bup/index.py
t/test-save-with-valid-parent.sh [new file with mode: 0755]