handle locally existing branches
This commit is contained in:
parent
0675918362
commit
1af213a95a
@ -10,8 +10,14 @@ while true; do
|
|||||||
|
|
||||||
if [ -n "$branch_with_new_commits" ]; then
|
if [ -n "$branch_with_new_commits" ]; then
|
||||||
echo "checking out branch: $branch_with_new_commits"
|
echo "checking out branch: $branch_with_new_commits"
|
||||||
echo "git checkout -b \"$branch_with_new_commits\" \"origin/$branch_with_new_commits\""
|
if git show-ref --quiet --heads "$branch_with_new_commits"; then
|
||||||
|
echo "Branch $branch_with_new_commits already exists. Checking it out and pulling latest changes."
|
||||||
|
git checkout "$branch_with_new_commits"
|
||||||
|
git pull origin "$branch_with_new_commits"
|
||||||
|
else
|
||||||
|
echo "Creating and checking out new branch: $branch_with_new_commits"
|
||||||
git checkout -b "$branch_with_new_commits" "origin/$branch_with_new_commits"
|
git checkout -b "$branch_with_new_commits" "origin/$branch_with_new_commits"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "building ..."
|
echo "building ..."
|
||||||
./gradlew test
|
./gradlew test
|
||||||
|
Loading…
Reference in New Issue
Block a user