Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-05-31 19:56:20 +0300
committerJunio C Hamano <gitster@pobox.com>2021-06-02 04:01:54 +0300
commit9910cbb6f988341001ded0c879fb54865a19d592 (patch)
treec461967c53112758ffe7c598cc70cd972139c41f /t/t1401-symbolic-ref.sh
parentdd8468ef000ec115d8e49d8b7063e30764592b0f (diff)
t1401: use tar to snapshot and restore repo state
This is agnostic to the ref storage format Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1401-symbolic-ref.sh')
-rwxr-xr-xt/t1401-symbolic-ref.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index a4ebb0b65f..7a9629fb9f 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 &&