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
10 test_expect_success setup '
12 git commit --allow-empty -m one &&
13 one=$(git rev-parse HEAD) &&
14 git for-each-ref >actual &&
15 echo "$one commit refs/heads/main" >expect &&
16 test_cmp expect actual &&
18 git pack-refs --all &&
19 git for-each-ref >actual &&
20 echo "$one commit refs/heads/main" >expect &&
21 test_cmp expect actual &&
23 git checkout --orphan another &&
25 git commit --allow-empty -m two &&
26 two=$(git rev-parse HEAD) &&
27 git checkout -B main &&
28 git branch -D another &&
30 git for-each-ref >actual &&
31 echo "$two commit refs/heads/main" >expect &&
32 test_cmp expect actual &&
34 git reflog expire --expire=now --all &&
36 git tag -m v1.0 v1.0 main
39 test_expect_success 'no error from stale entry in packed-refs' '
40 git describe main >actual 2>&1 &&
41 echo "v1.0" >expect &&
42 test_cmp expect actual