Thread (129 messages) 129 messages, 6 authors, 2021-06-02
STALE1857d
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 05/22] t1401: use tar to snapshot and restore repo state

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-05-31 17:39:46
Subsystem: the rest · Maintainer: Linus Torvalds

From: Han-Wen Nienhuys <redacted>

This is agnostic to the ref storage format

Signed-off-by: Han-Wen Nienhuys <redacted>
---
 t/t1401-symbolic-ref.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index a4ebb0b65fec..7a9629fb9f0e 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -7,9 +7,16 @@ test_description='basic symbolic-ref tests'
 # the git repo, meaning that further tests will operate on
 # the surrounding git repo instead of the trash directory.
 reset_to_sane() {
-	echo ref: refs/heads/foo >.git/HEAD
+	rm -rf .git &&
+	"$TAR" xf .git.tar
 }
 
+test_expect_success 'setup' '
+	git symbolic-ref HEAD refs/heads/foo &&
+	test_commit file &&
+	"$TAR" cf .git.tar .git/
+'
+
 test_expect_success 'symbolic-ref writes HEAD' '
 	git symbolic-ref HEAD refs/heads/foo &&
 	echo ref: refs/heads/foo >expect &&
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help