Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-09-22 21:46:57 +0400
committerCiro Santilli <ciro.santilli@gmail.com>2014-09-22 23:37:52 +0400
commit065ab3e5f302434a189038aa46a475154c79a91d (patch)
tree7c0c19326be64bb3b6b6e1f4353cdad44fa3e251 /lib/tasks/gitlab/shell.rake
parentb43e918a73c88a8d922c5c5d79e2aa2bf42a9d29 (diff)
Only clone GitLab Shell on tests if necessary.
Diffstat (limited to 'lib/tasks/gitlab/shell.rake')
-rw-r--r--lib/tasks/gitlab/shell.rake5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index ece3ad58385..2834570d8f0 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -22,7 +22,10 @@ namespace :gitlab do
# Make sure we're on the right tag
Dir.chdir(target_dir) do
- sh "git fetch origin && git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
+ # First try to checkout without fetching
+ # to avoid stalling tests if the Internet is down.
+ reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
+ sh "#{reset} || git fetch origin && #{reset}"
redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379")