]> arthur.barton.de Git - bup.git/commitdiff
test-save-restore: be independent of user's git defaultBranch
authorRob Browning <rlb@defaultvalue.org>
Sat, 4 Sep 2021 20:42:08 +0000 (15:42 -0500)
committerRob Browning <rlb@defaultvalue.org>
Thu, 9 Sep 2021 07:05:36 +0000 (02:05 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
test/ext/test-save-restore

index 48c9e0d76af7d065e7f56ef620253cc253a7e657..30ade4c5c078dba56a0a61fc2896e9cff52d0222 100755 (executable)
@@ -27,6 +27,8 @@ WVPASS cd "$tmpdir"
 
 WVSTART "init"
 WVPASS bup init
+# Be independent of git defaults or a configured defaultBranch
+git --git-dir "$BUP_DIR" symbolic-ref HEAD refs/heads/main
 D=bupdata.tmp
 WVPASS force-delete $D
 WVPASS mkdir $D
@@ -45,11 +47,11 @@ WVPASS force-delete buprestore.tmp
 WVFAIL bup restore boink
 WVPASS touch "$tmpdir/$D/$D"
 WVPASS bup index -u "$tmpdir/$D"
-WVPASS bup save -n master /
-WVPASS bup restore -C buprestore.tmp "/master/latest/$tmpdir/$D"
+WVPASS bup save -n main /
+WVPASS bup restore -C buprestore.tmp "/main/latest/$tmpdir/$D"
 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
 WVPASS force-delete buprestore.tmp
-WVPASS bup restore -C buprestore.tmp "/master/latest/$tmpdir/$D/"
+WVPASS bup restore -C buprestore.tmp "/main/latest/$tmpdir/$D/"
 WVPASS touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
 WVPASS diff -ur $D/ buprestore.tmp/
 WVPASS force-delete buprestore.tmp