Merge "Revert "Fix git branch repos pipeline""
diff --git a/branch-git-repos.groovy b/branch-git-repos.groovy
index b5a65b5..0624c40 100644
--- a/branch-git-repos.groovy
+++ b/branch-git-repos.groovy
@@ -110,14 +110,14 @@
sh 'git config user.email "ci+infra@mirantis.com"'
// Update list of branches
- sh 'git fetch --prune --tags'
+ sh 'git remote update origin --prune'
// Ensure there is no branch or tag with gitBranchNew name
sh "git branch -d '${gitBranchNew}' && git push origin ':${gitBranchNew}' || :"
sh "git tag -d '${gitBranchNew}' && git push origin ':refs/tags/${gitBranchNew}' || :"
// Create new branch
- sh "git branch '${gitBranchNew}' '${gitSrcObj}'" // Create new local branch
+ sh "git checkout -b '${gitBranchNew}' '${gitSrcObj}'" // Create new local branch
sh "git push origin '${gitBranchNew}'" // ... push new branch
}
}