bup had a convenience feature where commands would automagically
initialize a repo in ~/.bup if it didn't exist and no other BUP_DIR
was given.
This had the odd effect that when one forgot to specify BUP_DIR, a bup
repo would be initialized in ~/.bup even though only a browsing
command was used.
This patch drops that behaviour. Now all repositories must be
explicitly intiialized via "bup init".
Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: edit commit message; fix test ("set +e" during
init run).]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-meta.sh
t/test-restore-single-file.sh
t/test-rm-between-index-and-save.sh
+ t/test-command-without-init-fails.sh
t/test.sh
stupid:
os.stat(repo('objects/pack/.'))
except OSError, e:
if e.errno == errno.ENOENT:
- if repodir != home_repodir:
- log('error: %r is not a bup repository; run "bup init"\n'
- % repo())
- sys.exit(15)
- else:
- init_repo()
+ log('error: %r is not a bup repository; run "bup init"\n'
+ % repo())
+ sys.exit(15)
else:
log('error: %s\n' % e)
sys.exit(14)
--- /dev/null
+#!/usr/bin/env bash
+. ./wvtest-bup.sh
+
+set -e -o pipefail
+
+WVSTART 'all'
+
+top="$(pwd)"
+tmpdir="$(wvmktempdir)"
+export BUP_DIR="$tmpdir/bup"
+
+bup() { "$top/bup" "$@"; }
+
+mkdir "$tmpdir/foo"
+
+set +e
+bup index "$tmpdir/foo" &> /dev/null
+index_rc=$?
+set -e
+WVPASSEQ "$index_rc" "15"
+
+rm -rf "$tmpdir"