sha1_name: use bsearch_pack() in unique_in_pack()
[alt-git.git] / t / t1408-packed-refs.sh
blob1e44a17eead4dc8efb9aa6594ef8108e71532d78
1 #!/bin/sh
3 test_description='packed-refs entries are covered by loose refs'
5 . ./test-lib.sh
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 &&
15 git pack-refs --all &&
16 git for-each-ref >actual &&
17 echo "$one commit refs/heads/master" >expect &&
18 test_cmp expect actual &&
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 &&
27 git for-each-ref >actual &&
28 echo "$two commit refs/heads/master" >expect &&
29 test_cmp expect actual &&
31 git reflog expire --expire=now --all &&
32 git prune &&
33 git tag -m v1.0 v1.0 master
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
42 test_done