diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2014-12-12 10:17:07 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2014-12-12 10:17:07 +0100 |
commit | bd43cf065384745e4386237ad0f5d4eb14868034 (patch) | |
tree | b4db72785a2275d251aae9648fda51271934f31c /lib | |
parent | cd4c65c159627ead220bcadbe1a58ced0017851b (diff) | |
download | gitlab-ce-bd43cf065384745e4386237ad0f5d4eb14868034.tar.gz |
Use system where only return result is needed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 84bc9e304b6..ce5bec39c9d 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -17,17 +17,17 @@ namespace :gitlab do # Clone if needed unless File.directory?(target_dir) - Gitlab::Popen.popen(%W(git clone -- #{args.repo} #{target_dir})) + system(%W(git clone -- #{args.repo} #{target_dir})) end # Make sure we're on the right tag Dir.chdir(target_dir) do # First try to checkout without fetching # to avoid stalling tests if the Internet is down. - reset_status = reset_to_commit(args) + reseted = reset_to_commit(args) - if reset_status != 0 - Gitlab::Popen.popen(%W(git fetch origin)) + unless reseted + system(%W(git fetch origin)) reset_to_commit(args) end @@ -58,7 +58,7 @@ namespace :gitlab do File.open("config.yml", "w+") {|f| f.puts config.to_yaml} # Launch installation process - Gitlab::Popen.popen(%W(bin/install)) + system(%W(bin/install)) end # Required for debian packaging with PKGR: Setup .ssh/environment with @@ -126,13 +126,12 @@ namespace :gitlab do def reset_to_commit(args) tag, status = Gitlab::Popen.popen(%W(git describe -- #{args.tag})) - if status != 0 + unless status.zero? tag, status = Gitlab::Popen.popen(%W(git describe -- origin/#{args.tag})) end tag = tag.strip - reset, reset_status = Gitlab::Popen.popen(%W(git reset --hard #{tag})) - reset_status + system(%W(git reset --hard #{tag})) end end |