File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1012,10 +1012,25 @@ test_expect_success '%(describe:tags) vs git describe --tags' '
1012
1012
1013
1013
test_expect_success ' %(describe:abbrev=...) vs git describe --abbrev=...' '
1014
1014
test_when_finished "git tag -d tagname" &&
1015
+
1016
+ # Case 1: We have commits between HEAD and the most recent tag
1017
+ # reachable from it
1018
+ test_commit --no-tag file &&
1019
+ git describe --abbrev=15 >expect &&
1020
+ git log -1 --format="%(describe:abbrev=15)" >actual &&
1021
+ test_cmp expect actual &&
1022
+
1023
+ # Make sure the hash used is at least 15 digits long
1024
+ sed -e "s/^.*-g\([0-9a-f]*\)$/\1/" <actual >hexpart &&
1025
+ test 16 -le $(wc -c <hexpart) &&
1026
+
1027
+ # Case 2: We have a tag at HEAD, describe directly gives the
1028
+ # name of the tag
1015
1029
git tag -a -m tagged tagname &&
1016
1030
git describe --abbrev=15 >expect &&
1017
1031
git log -1 --format="%(describe:abbrev=15)" >actual &&
1018
- test_cmp expect actual
1032
+ test_cmp expect actual &&
1033
+ test tagname = $(cat actual)
1019
1034
'
1020
1035
1021
1036
test_expect_success ' log --pretty with space stealing' '
You can’t perform that action at this time.
0 commit comments