Skip to content

Internal refactor of Git::Lib command #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove nested arrays from global_opts
  • Loading branch information
jcouball committed Feb 15, 2023
commit 85f61d9608176fc88958e6a38bfcb8a60d7ca69b
8 changes: 4 additions & 4 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1120,12 +1120,12 @@ def command(cmd, *opts, &block)
global_opts = []
global_opts << "--git-dir=#{@git_dir}" if !@git_dir.nil?
global_opts << "--work-tree=#{@git_work_dir}" if !@git_work_dir.nil?
global_opts << %w[-c core.quotePath=true]
global_opts << %w[-c color.ui=false]
global_opts << '-c' << 'core.quotePath=true'
global_opts << '-c' << 'color.ui=false'

opts = [opts].flatten.map {|s| escape(s) }.join(' ')
opts = [opts].flatten.map { |s| escape(s) }.join(' ')

global_opts = global_opts.flatten.map {|s| escape(s) }.join(' ')
global_opts = global_opts.map { |s| escape(s) }.join(' ')

git_cmd = "#{Git::Base.config.binary_path} #{global_opts} #{cmd} #{opts} #{command_opts[:redirect]} 2>&1"

Expand Down