# File lib/rubygems/commands/environment_command.rb, line 167
def git_path
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "git#{ext}")
return exe if File.executable?(exe) && !File.directory?(exe)
end
end
return nil
end