]> arthur.barton.de Git - bup.git/blob - t/test-index-clear.sh
test-restore-map-owner: accommodate python 3 and test there
[bup.git] / t / test-index-clear.sh
1 #!/usr/bin/env bash
2 . ./wvtest-bup.sh || exit $?
3
4 set -o pipefail
5
6 top="$(WVPASS pwd)" || exit $?
7 tmpdir="$(WVPASS wvmktempdir)" || exit $?
8
9 export BUP_DIR="$tmpdir/bup"
10 export GIT_DIR="$tmpdir/bup"
11
12 bup() { "$top/bup" "$@"; }
13
14
15 WVPASS bup init
16 WVPASS cd "$tmpdir"
17
18
19 WVSTART "index --clear"
20 WVPASS mkdir src
21 WVPASS touch src/foo src/bar
22 WVPASS bup index -u src
23 WVPASSEQ "$(bup index -p)" "src/foo
24 src/bar
25 src/
26 ./"
27 WVPASS rm src/foo
28 WVPASS bup index --clear
29 WVPASS bup index -u src
30 expected="$(WVPASS bup index -p)" || exit $?
31 WVPASSEQ "$expected" "src/bar
32 src/
33 ./"
34
35
36 WVPASS rm -rf "$tmpdir"