From 437f53cdcf6f75727c6064b116f1b971529d4849 Mon Sep 17 00:00:00 2001 From: Alejandro Pedraza Date: Mon, 27 Apr 2020 11:08:51 -0500 Subject: [PATCH] Fix bin/root-tag when applied to annotated tags (#4299) Fixes #4298 Since we started using using annotated tags for releases (because they need to be signed), `bin/root-tag` will append `^0` to them when used after checking out a release tag. E.g.: ``` $ bin/root-tag edge-20.4.4^0 ``` which breaks version checking by the CLI. This PR removes that trailing `^0` whenever it's present --- bin/_tag.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/_tag.sh b/bin/_tag.sh index 8764433a9..07ed6ef4f 100644 --- a/bin/_tag.sh +++ b/bin/_tag.sh @@ -17,7 +17,9 @@ clean_head() { } named_tag() { - echo "$(git name-rev --tags --name-only $(git_sha_head))" + tag="$(git name-rev --tags --name-only $(git_sha_head))" + tag=${tag%"^0"} + echo "${tag}" } head_root_tag() {