Merge branch 'sb/status-doc-fix' into next
[git] / t / t1408-packed-refs.sh
1 #!/bin/sh
2
3 test_description='packed-refs entries are covered by loose refs'
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8         test_tick &&
9         git commit --allow-empty -m one &&
10         one=$(git rev-parse HEAD) &&
11         git for-each-ref >actual &&
12         echo "$one commit       refs/heads/master" >expect &&
13         test_cmp expect actual &&
14
15         git pack-refs --all &&
16         git for-each-ref >actual &&
17         echo "$one commit       refs/heads/master" >expect &&
18         test_cmp expect actual &&
19
20         git checkout --orphan another &&
21         test_tick &&
22         git commit --allow-empty -m two &&
23         two=$(git rev-parse HEAD) &&
24         git checkout -B master &&
25         git branch -D another &&
26
27         git for-each-ref >actual &&
28         echo "$two commit       refs/heads/master" >expect &&
29         test_cmp expect actual &&
30
31         git reflog expire --expire=now --all &&
32         git prune &&
33         git tag -m v1.0 v1.0 master
34 '
35
36 test_expect_success 'no error from stale entry in packed-refs' '
37         git describe master >actual 2>&1 &&
38         echo "v1.0" >expect &&
39         test_cmp expect actual
40 '
41
42 test_done