Fix git branch repos pipeline
- use `git fetch` instead of `git remote update`
- use `git branch` instead of `git checkout -b`
Change-Id: Icd40383c456bbf78703f8347832c7c092681be91
See: https://mirantis.jira.com/browse/PROD-24436
diff --git a/branch-git-repos.groovy b/branch-git-repos.groovy
index 0624c40..b5a65b5 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 remote update origin --prune'
+ sh 'git fetch --prune --tags'
// 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 checkout -b '${gitBranchNew}' '${gitSrcObj}'" // Create new local branch
+ sh "git branch '${gitBranchNew}' '${gitSrcObj}'" // Create new local branch
sh "git push origin '${gitBranchNew}'" // ... push new branch
}
}