From 61a27bbb7d33189da09a0438f23ab163cce839a3 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 20 Apr 2012 21:17:43 +0600 Subject: [PATCH] Revert "[refs #90] more security" This reverts commit 09d9cdcb4a54082a31a5d04e972609e434ad41ec. --- app/models/pull_request.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index e0dc93a4d..c40b8cee8 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -47,8 +47,7 @@ class PullRequest < Issue def merge!(who) return false unless can_merge? Dir.chdir(path) do - system 'git config user.name', '\"#{who.uname}\"' - system 'git config user.email', '\"#{who.email}\"' + system "git config user.name \"#{who.uname}\" && git config user.email \"#{who.email}\"" if merge merging system("git push origin HEAD") @@ -69,10 +68,7 @@ class PullRequest < Issue def merge clone - Dir.chdir(path) do - system 'git checkout', data[:base_branch] - system 'git merge', '--no-ff', data[:head_branch] - end + system("cd #{path} && git checkout #{data[:base_branch]} && git merge --no-ff #{data[:head_branch]}") end def clone @@ -84,8 +80,7 @@ class PullRequest < Issue end Dir.chdir(path) do [data[:base_branch], data[:head_branch]].each do |branch| - system 'git checkout', branch - system 'git pull origin', branch + system "git checkout #{branch} && git pull origin #{branch}" end end # TODO catch errors