summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh10
1 files changed, 3 insertions, 7 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index c64d1766..7003b3a7 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -468,13 +468,9 @@ clone_or_update_repo_no_checkout ()
cd "$dir"
# Update from URL.
- git remote add "$remote" "$url" > /dev/null 2>&1 || true
- git remote set-url "$remote" "$url"
- if [ x"$single_branch" = x"" ]; then
- git remote set-branches "$remote" "*"
- else
- git remote set-branches "$remote" "$single_branch"
- fi
+ git remote rm "$remote" > /dev/null 2>&1 || true
+ git remote add ${single_branch:+-t "$single_branch"} "$remote" "$url"
+
local refspec="+refs/changes/*:refs/changes/*"
if [ x"$single_branch" = x"" ]; then
run_with_timeout_and_retry 1h 3 git remote update -p