3 test_description
='packed-refs entries are covered by loose refs'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success setup
'
13 git commit --allow-empty -m one &&
14 one=$(git rev-parse HEAD) &&
15 git for-each-ref >actual &&
16 echo "$one commit refs/heads/main" >expect &&
17 test_cmp expect actual &&
19 git pack-refs --all &&
20 git for-each-ref >actual &&
21 echo "$one commit refs/heads/main" >expect &&
22 test_cmp expect actual &&
24 git checkout --orphan another &&
26 git commit --allow-empty -m two &&
27 two=$(git rev-parse HEAD) &&
28 git checkout -B main &&
29 git branch -D another &&
31 git for-each-ref >actual &&
32 echo "$two commit refs/heads/main" >expect &&
33 test_cmp expect actual &&
35 git reflog expire --expire=now --all &&
37 git tag -m v1.0 v1.0 main
40 test_expect_success
'no error from stale entry in packed-refs' '
41 git describe main >actual 2>&1 &&
42 echo "v1.0" >expect &&
43 test_cmp expect actual