]>
Commit | Line | Data |
---|---|---|
f0298cf1 JS |
1 | #!/bin/sh |
2 | ||
3 | test_description='--all includes detached HEADs' | |
4 | ||
b2e5d75d | 5 | TEST_PASSES_SANITIZE_LEAK=true |
f0298cf1 JS |
6 | . ./test-lib.sh |
7 | ||
8 | ||
9 | commit () { | |
10 | test_tick && | |
11 | echo $1 > foo && | |
12 | git add foo && | |
13 | git commit -m "$1" | |
14 | } | |
15 | ||
16 | test_expect_success 'setup' ' | |
17 | ||
18 | commit one && | |
19 | commit two && | |
20 | git checkout HEAD^ && | |
21 | commit detached | |
22 | ||
23 | ' | |
24 | ||
25 | test_expect_success 'rev-list --all lists detached HEAD' ' | |
26 | ||
27 | test 3 = $(git rev-list --all | wc -l) | |
28 | ||
29 | ' | |
30 | ||
31 | test_expect_success 'repack does not lose detached HEAD' ' | |
32 | ||
33 | git gc && | |
34 | git prune --expire=now && | |
35 | git show HEAD | |
36 | ||
37 | ' | |
38 | ||
695985f4 DJ |
39 | test_expect_success 'rev-list --graph --no-walk is forbidden' ' |
40 | test_must_fail git rev-list --graph --no-walk HEAD | |
41 | ' | |
42 | ||
f0298cf1 | 43 | test_done |