scm: git: use --encoding=UTF-8 in "git log" (#3396).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4964 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
06c9eea67a
commit
eb1271bb44
|
@ -29,6 +29,10 @@ class Repository::Git < Repository
|
|||
'Git'
|
||||
end
|
||||
|
||||
def repo_log_encoding
|
||||
'UTF-8'
|
||||
end
|
||||
|
||||
# Returns the identifier for the given git changeset
|
||||
def self.changeset_identifier(changeset)
|
||||
changeset.scmid
|
||||
|
|
|
@ -129,7 +129,7 @@ module Redmine
|
|||
|
||||
def lastrev(path, rev)
|
||||
return nil if path.nil?
|
||||
cmd_args = %w|log --no-color --date=iso --pretty=fuller --no-merges -n 1|
|
||||
cmd_args = %w|log --no-color --encoding=UTF-8 --date=iso --pretty=fuller --no-merges -n 1|
|
||||
cmd_args << rev if rev
|
||||
cmd_args << "--" << path unless path.empty?
|
||||
lines = []
|
||||
|
@ -157,7 +157,7 @@ module Redmine
|
|||
|
||||
def revisions(path, identifier_from, identifier_to, options={})
|
||||
revisions = Revisions.new
|
||||
cmd_args = %w|log --no-color --raw --date=iso --pretty=fuller|
|
||||
cmd_args = %w|log --no-color --encoding=UTF-8 --raw --date=iso --pretty=fuller|
|
||||
cmd_args << "--reverse" if options[:reverse]
|
||||
cmd_args << "--all" if options[:all]
|
||||
cmd_args << "-n" << "#{options[:limit].to_i}" if options[:limit]
|
||||
|
|
Binary file not shown.
|
@ -28,11 +28,11 @@ begin
|
|||
end
|
||||
|
||||
def test_branches
|
||||
assert_equal @adapter.branches, ['master', 'test_branch']
|
||||
assert_equal @adapter.branches, ['master', 'test-latin-1', 'test_branch']
|
||||
end
|
||||
|
||||
def test_getting_all_revisions
|
||||
assert_equal 15, @adapter.revisions('',nil,nil,:all => true).length
|
||||
assert_equal 16, @adapter.revisions('',nil,nil,:all => true).length
|
||||
end
|
||||
|
||||
def test_getting_certain_revisions
|
||||
|
|
|
@ -38,8 +38,8 @@ class RepositoryGitTest < ActiveSupport::TestCase
|
|||
@repository.fetch_changesets
|
||||
@repository.reload
|
||||
|
||||
assert_equal 15, @repository.changesets.count
|
||||
assert_equal 24, @repository.changes.count
|
||||
assert_equal 16, @repository.changesets.count
|
||||
assert_equal 25, @repository.changes.count
|
||||
|
||||
commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
|
||||
assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
|
||||
|
@ -61,10 +61,10 @@ class RepositoryGitTest < ActiveSupport::TestCase
|
|||
# Remove the 3 latest changesets
|
||||
@repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
|
||||
@repository.reload
|
||||
assert_equal 12, @repository.changesets.count
|
||||
assert_equal 13, @repository.changesets.count
|
||||
|
||||
@repository.fetch_changesets
|
||||
assert_equal 15, @repository.changesets.count
|
||||
assert_equal 16, @repository.changesets.count
|
||||
end
|
||||
|
||||
def test_find_changeset_by_name
|
||||
|
|
Loading…
Reference in New Issue