From 5e85a4bb54f7b599b9a3d84dd384dfaa17ab3fb0 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Tue, 16 Jun 2020 14:43:56 -0700 Subject: [PATCH] remove leading path from branch name Remove the f/ or r/ from a branch name so we can create valid prefix for the new manifest that gets created with the --manifest flag. Change-Id: I4eb8f3c70f85566463fb114944309597241a7a89 Signed-off-by: Saul Wold --- build-tools/branching/create_branches_and_tags.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build-tools/branching/create_branches_and_tags.sh b/build-tools/branching/create_branches_and_tags.sh index a371cd13..d87e0987 100755 --- a/build-tools/branching/create_branches_and_tags.sh +++ b/build-tools/branching/create_branches_and_tags.sh @@ -100,7 +100,15 @@ if [ $MANIFEST -eq 1 ]; then exit 1 fi - new_manifest="$(dirname $manifest)/${branch}-$(basename $manifest)" + # String the leading feature (f/) or branch (b/) from the + # branch name so we have a valid branch prefix + if [[ ${branch} =~ .*/.*$ ]]; then + manifest_prefix="$(basename ${branch})" + else + manifest_prefix="${branch}" + fi + + new_manifest="$(dirname $manifest)/$manifest_prefix-$(basename $manifest)" if [ -f $new_manifest ]; then echo_stderr "branched manifest file already present '$new_manifest'." exit 1