Skip to content
Snippets Groups Projects
Commit a2ff65c2 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

Add -B option to switch to or reset and switch the branch if it already exists.

This will allow us to rerun the pipeline to test the PRs in external repos without
getting the `branch already exists` error. If the branch we are trying to create
already exists, it is reset and a new branch with the same name is created.
parent 80f22c3d
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,9 @@ build_packer:
echo "Inside first for loop cd to: $each_repo"
cd $each_repo
echo "Done cd to: $each_repo"
echo "git checkout -b test_feature_requests-${hashmap[$each_repo]}"
git checkout -b test_feature_requests-${hashmap[$each_repo]}
echo "Checking out pull requests ${hashmap[$each_repo]}"
git checkout -B test_feature_requests
git fetch origin +refs/pull/*/merge:refs/remotes/origin/pr/*
for each_feature in ${hashmap[$each_repo]}
do
for num in ${each_feature[@]}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment