Skip to content

Commit c10ca28

Browse files
authored
Fix issue with color escape codes after recent update of git binaries (#427)
Signed-off-by: Marcel Hoyer <m.hoyer@cid.com>
1 parent c85dd82 commit c10ca28

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/git/lib.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ def command(cmd, opts = [], chdir = true, redirect = '', &block)
945945
global_opts = []
946946
global_opts << "--git-dir=#{@git_dir}" if !@git_dir.nil?
947947
global_opts << "--work-tree=#{@git_work_dir}" if !@git_work_dir.nil?
948+
global_opts << ["-c", "color.ui=false"]
948949

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

tests/units/test_logger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_logger
1919
@git.branches.size
2020

2121
logc = File.read(log.path)
22-
assert(/INFO -- : git '--git-dir=[^']+' '--work-tree=[^']+' branch '-a'/.match(logc))
22+
assert(/INFO -- : git '--git-dir=[^']+' '--work-tree=[^']+' '-c' 'color.ui=false' branch '-a'/.match(logc))
2323
assert(/DEBUG -- : diff_over_patches/.match(logc))
2424

2525
log = Tempfile.new('logfile')
@@ -31,7 +31,7 @@ def test_logger
3131
@git.branches.size
3232

3333
logc = File.read(log.path)
34-
assert(/INFO -- : git '--git-dir=[^']+' '--work-tree=[^']+' branch '-a'/.match(logc))
34+
assert(/INFO -- : git '--git-dir=[^']+' '--work-tree=[^']+' '-c' 'color.ui=false' branch '-a'/.match(logc))
3535
assert(!/DEBUG -- : diff_over_patches/.match(logc))
3636
end
3737

0 commit comments

Comments
 (0)