Skip to content

Commit 205729f

Browse files
committed
Remove RUBYOPT env variable hack from execute
This was included a long time ago to make developing hooks easier. However, it's hacky, but more importantly it interferes with Travis CI runs since it kills the existing bundler context, resulting in issues like: /home/travis/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/ 1.9.1/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 42 total gem(s) (Gem::LoadError) Remove it to fix this issue. Change-Id: Id1b8181def00026ee0b6857614c31d576f9243fd Reviewed-on: http://gerrit.causes.com/46974 Tested-by: jenkins <jenkins@brigade.com> Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
1 parent 483a306 commit 205729f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/overcommit/utils.rb

+8-7
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,20 @@ def in_path?(cmd)
101101
false
102102
end
103103

104-
# Wrap external subshell calls. This is necessary in order to allow
105-
# Overcommit to call other Ruby executables without requiring that they be
106-
# specified in Overcommit's Gemfile--a nasty consequence of using
107-
# `bundle exec overcommit` while developing locally.
104+
# Wrap external subshell calls.
105+
#
106+
# This is intended to provide a centralized place to perform any checks or
107+
# filtering of the command before executing it.
108+
#
109+
# @param args [Array<String>]
110+
# @return [Overcommit::Subprocess::Result] status, stdout, and stderr
108111
def execute(args)
109112
if args.include?('|')
110113
raise Overcommit::Exceptions::InvalidCommandArgs,
111114
'Cannot pipe commands with the `execute` helper'
112115
end
113116

114-
with_environment 'RUBYOPT' => nil do
115-
Subprocess.spawn(args)
116-
end
117+
Subprocess.spawn(args)
117118
end
118119

119120
# Calls a block of code with a modified set of environment variables,

0 commit comments

Comments
 (0)