3 # Copyright (c) 2005 Amos Waterland
4 # Copyright (c) 2006 Christian Couder
7 test_description
='git pack-refs should not change the branch semantic
9 This test runs git pack-refs and git show-ref and checks that the branch
10 semantic is still the same.
15 'prepare a trivial repository' \
17 git-update-index --add A &&
18 git-commit -m "Initial commit." &&
19 HEAD=$(git-rev-parse --verify HEAD)'
24 'see if git show-ref works as expected' \
26 SHA1=$(< .git/refs/heads/a) &&
27 echo "$SHA1 refs/heads/a" >expect &&
28 git-show-ref a >result &&
32 'see if a branch still exists when packed' \
35 rm .git/refs/heads/b &&
36 echo "$SHA1 refs/heads/b" >expect &&
37 git-show-ref b >result &&
41 'git branch c/d should barf if branch c exists' \
44 rm .git/refs/heads/c &&
48 'see if a branch still exists after git pack-refs --prune' \
50 git-pack-refs --prune &&
51 echo "$SHA1 refs/heads/e" >expect &&
52 git-show-ref e >result &&
56 'see if git pack-refs --prune remove ref files' \
58 git-pack-refs --prune &&
62 'git branch g should work when git branch g/h has been deleted' \
64 git-pack-refs --prune &&