2011-10-20 21:00:00 +02:00
|
|
|
require 'grit'
|
2012-04-21 00:26:22 +02:00
|
|
|
require 'pygments'
|
2011-10-20 21:00:00 +02:00
|
|
|
|
2012-07-02 20:51:48 +02:00
|
|
|
Grit::Git.git_timeout = Gitlab.config.git_timeout
|
|
|
|
Grit::Git.git_max_size = Gitlab.config.git_max_size
|
2012-05-29 10:17:31 +02:00
|
|
|
|
2011-10-20 21:00:00 +02:00
|
|
|
Grit::Blob.class_eval do
|
2012-04-20 23:21:12 +02:00
|
|
|
include Linguist::BlobHelper
|
2011-10-24 21:38:03 +02:00
|
|
|
|
2012-05-29 10:17:31 +02:00
|
|
|
def data
|
|
|
|
@data ||= @repo.git.cat_file({:p => true}, id)
|
|
|
|
Gitlab::Encode.utf8 @data
|
2011-12-30 15:26:13 +01:00
|
|
|
end
|
2012-04-11 22:03:56 +02:00
|
|
|
end
|
2011-12-30 15:26:13 +01:00
|
|
|
|
2012-04-20 23:21:12 +02:00
|
|
|
Grit::Diff.class_eval do
|
2012-04-11 22:03:56 +02:00
|
|
|
def old_path
|
2012-05-29 10:17:31 +02:00
|
|
|
Gitlab::Encode.utf8 @a_path
|
2012-04-11 22:03:56 +02:00
|
|
|
end
|
2012-04-05 00:51:49 +02:00
|
|
|
|
2012-04-11 22:03:56 +02:00
|
|
|
def new_path
|
2012-05-29 10:17:31 +02:00
|
|
|
Gitlab::Encode.utf8 @b_path
|
2012-04-05 00:51:49 +02:00
|
|
|
end
|
2011-12-30 15:26:13 +01:00
|
|
|
|
2012-05-29 10:17:31 +02:00
|
|
|
def diff
|
|
|
|
Gitlab::Encode.utf8 @diff
|
|
|
|
end
|
|
|
|
end
|