зеркало из https://github.com/github/grit.git
locate git_binary on PATH at boot
Avoids starting a /bin/sh and /usr/bin/env process on each native command invocation, and will allow exec'ing the command directly.
This commit is contained in:
Родитель
6b7dff52aa
Коммит
2296c23d92
|
@ -37,11 +37,9 @@ module Grit
|
|||
attr_accessor :git_binary, :git_timeout, :git_max_size
|
||||
end
|
||||
|
||||
if RUBY_PLATFORM.downcase =~ /mswin(?!ce)|mingw|bccwin/
|
||||
self.git_binary = "git" # using search path
|
||||
else
|
||||
self.git_binary = "/usr/bin/env git"
|
||||
end
|
||||
self.git_binary = ENV['PATH'].split(':').
|
||||
map { |p| File.join(p, 'git') }.
|
||||
find { |p| File.exist?(p) }
|
||||
self.git_timeout = 10
|
||||
self.git_max_size = 5242880 # 5.megabytes
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче