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
3 merge requests!38Allow flexibility to define a target submodule and its branch,!37Allow flexibility to define a target submodule and its branch,!36Allow flexibility to define a target submodule and its branch
...@@ -46,8 +46,9 @@ build_packer: ...@@ -46,8 +46,9 @@ build_packer:
echo "Inside first for loop cd to: $each_repo" echo "Inside first for loop cd to: $each_repo"
cd $each_repo cd $each_repo
echo "Done cd to: $each_repo" echo "Done cd to: $each_repo"
echo "git checkout -b test_feature_requests-${hashmap[$each_repo]}" echo "Checking out pull requests ${hashmap[$each_repo]}"
git checkout -b test_feature_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]} for each_feature in ${hashmap[$each_repo]}
do do
for num in ${each_feature[@]} 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