]> source.dussan.org Git - redmine.git/commitdiff
Force color to be disabled on git shell-outs. #5324
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 29 Oct 2010 23:21:57 +0000 (23:21 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 29 Oct 2010 23:21:57 +0000 (23:21 +0000)
Contributed by Felix Schäfer

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4310 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/git_adapter.rb
test/fixtures/repositories/git_repository.tar.gz

index 5ed57c264293096e83bff89b7868811206bf97d7..1db57c7d652518485fa7f46931adeae68bcebcbd 100644 (file)
@@ -35,7 +35,7 @@ module Redmine
         def branches
           return @branches if @branches
           @branches = []
-          cmd = "#{GIT_BIN} --git-dir #{target('')} branch"
+          cmd = "#{GIT_BIN} --git-dir #{target('')} branch --no-color"
           shellout(cmd) do |io|
             io.each_line do |line|
               @branches << line.match('\s*\*?\s*(.*)$')[1]
@@ -86,7 +86,7 @@ module Redmine
 
         def lastrev(path,rev)
           return nil if path.nil?
-          cmd = "#{GIT_BIN} --git-dir #{target('')} log --date=iso --pretty=fuller --no-merges -n 1 "
+          cmd = "#{GIT_BIN} --git-dir #{target('')} log --no-color --date=iso --pretty=fuller --no-merges -n 1 "
           cmd << " #{shell_quote rev} " if rev 
           cmd <<  "-- #{shell_quote path} " unless path.empty?
           shellout(cmd) do |io|
@@ -114,7 +114,7 @@ module Redmine
         def revisions(path, identifier_from, identifier_to, options={})
           revisions = Revisions.new
 
-          cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller "
+          cmd = "#{GIT_BIN} --git-dir #{target('')} log --no-color --raw --date=iso --pretty=fuller "
           cmd << " --reverse " if options[:reverse]
           cmd << " --all " if options[:all]
           cmd << " -n #{options[:limit]} " if options[:limit]
@@ -209,7 +209,7 @@ module Redmine
           path ||= ''
 
           if identifier_to
-            cmd = "#{GIT_BIN} --git-dir #{target('')} diff #{shell_quote identifier_to} #{shell_quote identifier_from}" 
+            cmd = "#{GIT_BIN} --git-dir #{target('')} diff --no-color #{shell_quote identifier_to} #{shell_quote identifier_from}" 
           else
             cmd = "#{GIT_BIN} --git-dir #{target('')} show #{shell_quote identifier_from}"
           end
index 17cb22943b34d75268ded8cbbacb66a5cbda3d8b..58b4df5fdb0c97b8a3f06b48f44eb33032cd3899 100644 (file)
Binary files a/test/fixtures/repositories/git_repository.tar.gz and b/test/fixtures/repositories/git_repository.tar.gz differ