summaryrefslogtreecommitdiff
path: root/lib/gitlab/popen.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-02-25 11:58:22 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-02-25 11:58:22 +0100
commit8016cefafe97d3a143cf21b270c110d357e46273 (patch)
treee00de389d4914bd1f3be3d05f6c50d23ab592735 /lib/gitlab/popen.rb
parent0432bdf19eb3483e109582832a36dc7a3601a384 (diff)
downloadgitlab-ce-8016cefafe97d3a143cf21b270c110d357e46273.tar.gz
Make the Gitlab::Popen path argument optional
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r--lib/gitlab/popen.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb
index d10269f4438..f9559012c4a 100644
--- a/lib/gitlab/popen.rb
+++ b/lib/gitlab/popen.rb
@@ -3,11 +3,12 @@ require 'open3'
module Gitlab
module Popen
- def popen(cmd, path)
+ def popen(cmd, path=nil)
unless cmd.is_a?(Array)
raise "System commands must be given as an array of strings"
end
+ path ||= Dir.pwd
vars = { "PWD" => path }
options = { chdir: path }