From f32c3e5b09af170d9c57b3b64e49d9a6ea7c7f22 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Wed, 5 Aug 2020 07:42:29 -0700 Subject: [PATCH] branch-repo: Give tag a better description When we are using the script for tagging only make sure we use a better description of the tag since it's the Release tag vs the Branching tag. Change-Id: I50f34c818c650a422d415b084a42345307baa5c8 Signed-off-by: Saul Wold --- release/branch-repo.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/release/branch-repo.sh b/release/branch-repo.sh index 59f47711..fb147f3c 100755 --- a/release/branch-repo.sh +++ b/release/branch-repo.sh @@ -128,6 +128,7 @@ function branch_repo { local sha=$3 local branch=$4 local tag=${5:-""} + local branch_created=0 local repo_dir if [[ -n $SKIP_PATH || "$path" == "-" ]]; then @@ -154,11 +155,16 @@ function branch_repo { if ! git branch | grep ${branch}$; then # Create the new branch if it does not exist git branch $branch $sha + branch_created=1 fi if [[ -n $tag ]]; then # tag branch point at $sha - git tag -s -m "Branch $branch" -f $tag $sha + if [ $branch_created -eq 1 ]; then + git tag -s -m "Branch $branch" -f $tag $sha + else + git tag -s -m "Tag $tag Release" -f $tag $sha + fi fi # Push the new goodness back up