3 test_description
='test describe
6 .--------------o----o----o----x
8 o----o----o----o----o----. /
10 .------------o---o---o
18 R
=$
(git describe
"$@")
20 test_expect_success
"describe $*" '
23 $expect) echo happy ;;
24 *) echo "Oops - $R is not $expect";
30 test_expect_success setup
'
33 echo one >file && git add file && git-commit -m initial &&
34 one=$(git rev-parse HEAD) &&
37 echo two >file && git add file && git-commit -m second &&
38 two=$(git rev-parse HEAD) &&
41 echo three >file && git add file && git-commit -m third &&
44 echo A >file && git add file && git-commit -m A &&
49 echo c >file && git add file && git-commit -m c &&
53 git reset --hard $two &&
55 echo B >side && git add side && git-commit -m B &&
60 git-merge -m Merged c &&
61 merged=$(git rev-parse HEAD) &&
63 git reset --hard $two &&
65 echo D >another && git add another && git-commit -m D &&
70 echo DD >another && git commit -a -m another &&
76 echo DDD >another && git commit -a -m "yet another" &&
79 git-merge -m Merged $merged &&
82 echo X >file && echo X >side && git add file side &&
87 check_describe A-
* HEAD
88 check_describe A-
* HEAD^
89 check_describe D-
* HEAD^^
90 check_describe A-
* HEAD^^
2
91 check_describe B HEAD^^
2^
93 check_describe A-
* --tags HEAD
94 check_describe A-
* --tags HEAD^
95 check_describe D-
* --tags HEAD^^
96 check_describe A-
* --tags HEAD^^
2
97 check_describe B
--tags HEAD^^
2^
99 check_describe B-0-
* --long HEAD^^
2^
101 test_expect_success
'pack tag refs' 'git pack-refs'
102 check_describe A-
* HEAD