grit icon indicating copy to clipboard operation
grit copied to clipboard

Global git color configuration breaks Grit::Repo.log()

Open marcaddeo opened this issue 7 years ago • 0 comments

If you have the following in your ~/.gitconfig, Grit::Repo.log() will break.

[color]
  ui = always

To reproduce:

require_relative "lib/grit.rb"

Grit.debug = true
repo = Grit::Repo.new("test/dot_git", :is_bare => true)

repo.log("master", nil, :max_count => 1)

repo.log

Which outputs/throws the following error (screenshot to show colored output):

image

Right now I've only seen it specifically happening with the log method, as it was causing Gollum to crash immediately after I started using it.

Might be wise to add --color=never to all git commands, but I'm not even sure the flag is supported by all commands.

marcaddeo avatar May 23 '17 19:05 marcaddeo