Prior to this change[1], the commit time zone offset was generated
incorrectly for non-integer hour offsets from UTC; seconds, rather
than minutes, were output. Such values in a bup commit cause
subsequent attempts to access the repository to fail with "Exception:
cannot parse commit".
When run with TZ=Australia/Adelaide the test suite failed in several
places. Add a test which sets the time zone explicitly and tests a
save for consistency.
[1] Fix utc_offset_str for fractional TZs
f25ef2e868f85ca19bfce314081c956ade9c10ef
Signed-off-by: David Kettler <kettler@internode.on.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: remove proposed utc_offset_str fix; adjust
commit message]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/test-index-clear.sh \
t/test-index-check-device.sh \
t/test-ls.sh \
+ t/test-tz.sh \
t/test-meta.sh \
t/test-on.sh \
t/test-restore-map-owner.sh \
--- /dev/null
+#!/usr/bin/env bash
+. ./wvtest-bup.sh || exit $?
+
+set -o pipefail
+
+top="$(WVPASS pwd)" || exit $?
+tmpdir="$(WVPASS wvmktempdir)" || exit $?
+
+export BUP_DIR="$tmpdir/bup"
+export GIT_DIR="$tmpdir/bup"
+
+bup() { "$top/bup" "$@"; }
+
+WVSTART "half hour TZ"
+
+export TZ=ACDT-10:30
+
+WVPASS bup init
+WVPASS cd "$tmpdir"
+
+WVPASS mkdir src
+WVPASS bup index src
+WVPASS bup save -n src -d 1420164180 src
+
+WVPASSEQ "$(WVPASS git cat-file commit src | sed -ne 's/^author .*> //p')" \
+"1420164180 +1030"
+
+WVPASSEQ "$(WVPASS bup ls /src)" \
+"2015-01-02-123300
+latest"
+
+WVPASS rm -rf "$tmpdir"