Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
12c01d74
Commit
12c01d74
authored
Nov 30, 2011
by
Saito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix encode bugs on diff not utf-8 encode's code
parent
f114a4f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/views/commits/_text_file.html.haml
app/views/commits/_text_file.html.haml
+1
-1
lib/utils.rb
lib/utils.rb
+2
-2
No files found.
app/views/commits/_text_file.html.haml
View file @
12c01d74
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
-
line_new
=
0
-
line_new
=
0
-
lines_arr
=
diff
.
diff
.
lines
.
to_a
-
lines_arr
=
diff
.
diff
.
lines
.
to_a
-
lines_arr
.
each
do
|
line
|
-
lines_arr
.
each
do
|
line
|
-
encode
(
line
)
-
line
=
encode
(
line
)
-
next
if
line
.
match
(
/^--- \/dev\/null/
)
-
next
if
line
.
match
(
/^--- \/dev\/null/
)
-
next
if
line
.
match
(
/^--- a/
)
-
next
if
line
.
match
(
/^--- a/
)
-
next
if
line
.
match
(
/^\+\+\+ b/
)
-
next
if
line
.
match
(
/^\+\+\+ b/
)
...
...
lib/utils.rb
View file @
12c01d74
...
@@ -29,12 +29,12 @@ module Utils
...
@@ -29,12 +29,12 @@ module Utils
module
Colorize
module
Colorize
include
CharEncode
include
CharEncode
def
colorize
def
colorize
system_colorize
(
encode
(
data
)
,
name
)
system_colorize
(
data
,
name
)
end
end
def
system_colorize
(
data
,
file_name
)
def
system_colorize
(
data
,
file_name
)
ft
=
handle_file_type
(
file_name
)
ft
=
handle_file_type
(
file_name
)
Pygments
.
highlight
(
data
,
:lexer
=>
ft
,
:options
=>
{
:encoding
=>
'utf-8'
,
:linenos
=>
'True'
})
Pygments
.
highlight
(
encode
(
data
)
,
:lexer
=>
ft
,
:options
=>
{
:encoding
=>
'utf-8'
,
:linenos
=>
'True'
})
end
end
def
handle_file_type
(
file_name
,
mime_type
=
nil
)
def
handle_file_type
(
file_name
,
mime_type
=
nil
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment