aboutsummaryrefslogtreecommitdiff
path: root/t/t6120-describe.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-29 11:23:41 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-29 11:23:41 +0900
commit8c1bc7c244bf19e5c9fe5caa74389c022b8d24bc (patch)
tree3c1c70bb07c143f4e82ce9d2b0b1f9b3b1e7d130 /t/t6120-describe.sh
parent075bc9c79818a5e18b43f6e5aeb8ff6415381ca9 (diff)
parent6d68b2ab78cb670dd474dd61b1b2ec0a407cb9b8 (diff)
downloadgit-8c1bc7c244bf19e5c9fe5caa74389c022b8d24bc.tar.gz
git-8c1bc7c244bf19e5c9fe5caa74389c022b8d24bc.tar.xz
Merge branch 'mk/describe-match-with-all'
"git describe --match <pattern>" has been taught to play well with the "--all" option. * mk/describe-match-with-all: describe: teach --match to handle branches and remotes
Diffstat (limited to 't/t6120-describe.sh')
-rwxr-xr-xt/t6120-describe.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 70d92d24c..1c0e8659d 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -190,6 +190,33 @@ check_describe "test1-lightweight-*" --long --tags --match="test1-*" --match="te
check_describe "test1-lightweight-*" --long --tags --match="test3-*" --match="test1-*" HEAD
+test_expect_success 'set-up branches' '
+ git branch branch_A A &&
+ git branch branch_C c &&
+ git update-ref refs/remotes/origin/remote_branch_A "A^{commit}" &&
+ git update-ref refs/remotes/origin/remote_branch_C "c^{commit}" &&
+ git update-ref refs/original/original_branch_A test-annotated~2
+'
+
+check_describe "heads/branch_A*" --all --match="branch_*" --exclude="branch_C" HEAD
+
+check_describe "remotes/origin/remote_branch_A*" --all --match="origin/remote_branch_*" --exclude="origin/remote_branch_C" HEAD
+
+check_describe "original/original_branch_A*" --all test-annotated~1
+
+test_expect_success '--match does not work for other types' '
+ test_must_fail git describe --all --match="*original_branch_*" test-annotated~1
+'
+
+test_expect_success '--exclude does not work for other types' '
+ R=$(git describe --all --exclude="any_pattern_even_not_matching" test-annotated~1) &&
+ case "$R" in
+ *original_branch_A*) echo "fail: Found unknown reference $R with --exclude"
+ false;;
+ *) echo ok: Found some known type;;
+ esac
+'
+
test_expect_success 'name-rev with exact tags' '
echo A >expect &&
tag_object=$(git rev-parse refs/tags/A) &&